Oracle bets Java EE future on REST APIs

Oracle is banking on REST and JSON to modernize Java EE for microservices and the cloud.

It may seem like ages since REST stole thunder from SOAP as a mechanism for providing web services communications. REST, in conjunction with JSON and HTTP, proved a far simpler means for delivering web services than SOAP, which has long been criticized for complexity.

“When people are building microservices nowadays, they do tend to be REST-based, so that tends to be focused around JAX-RS [Java API for RESTful Web Services], which is a key spec that is being upgraded,” Oracle’s Mike Lehman, vice president of product management, says.

This upgraded spec, JAX-RS 2.1, will focus on a range of capabilities, including Server-Sent Events (SSE) and integrations with JSON-B and Contexts and Dependency Injection (CDI). Java EE 8 will feature JAX-RS 2.1, thereby facilitating REST communications, which Lehman says is the typical method coarse-grained microservices communicate with one another, almost by default.

A former Oracle Java EE evangelist who has remained a pro-EE activist is on board with REST as an anchor for microservices.

“REST is indeed a key part of most microservices,” says Reza Rahman, who heads up Java Guardians, a Java EE interest group, and works as a senior architect at consultant CapTech. “As a result, JAX-RS 2.1 -- the REST API in Java EE 8 -- has a robust set of improvements.”

REST and microservices for Java EE have both been given a thumbs-up in recent surveys of Java developers. Oracle late last year surveyed 1,700 users and found REST and HTTP2 were the two most sought technologies for inclusion in Java EE. Oracle in December reported that most of the API work for these two technologies, including JAX-RS 2.1, was already complete. Also, there's work underway on the Glassfish application server, providing an EE reference implementation, to update various Java Specification Requests.

In a jointly conducted survey, Java EE Guardians and DZone found that 44 percent of respondents are seeking standardized features such as uber-JARs (featuring a Java program and dependencies), discovery, metrics, circuit breakers, and bulkheads for help in architecting microservices. But 27 percent felt Java is already well-suited for building practical microservices. Only 4 percent saw microservices as “merely hype.”

Java users also place high priority on JSON-B, the Java API for JSON binding. The JSON data interchange format provides the mechanism for formatting data on the wire, Lehman notes. To that end, Java EE 8 will feature JSON-B 1.0, for binding a JSON object to the Java language, and JSON-P (JSON with Padding) 1.1, which provides a parsing API.

“These tend to be a way for the programmer who’s writing a microservice to invoke other microservices and then process and work with the payload that is in that REST call,” Lehman says.

Java EE 8 also makes accommodations for HTTP2; while this specification is not specifically oriented toward microservices, it does provide a standard HTTP2 API.

For the cloud, Java EE and Java itself are merely runtimes on a cloud platform, Lehman says. “They need to be able to interact with common cloud platform capabilities,” such as database access, he adds.

Java provides programming APIs to interact with these, such as REST and JSON.

“What we want to do in Java EE 8, and with any kind of microservices platform, is make sure they can easily interact with cloud services -- storage, persistence management and monitoring, and so forth,” Lehman says.

Oracle also has its sights set on Java EE 9, due in 2018, which is slated to add capabilities for scalable, independent services and key-value store support. Rahman, though, wonders if perhaps Java EE 9 has the right focus.

“Personally, the focus of Java EE 9 makes me wonder if we are about to prematurely standardize a number of features that should not yet be standardized,” Rahman says. He cites features such as a new API to dynamically configure Java EE applications, native support for OAuth/OpenID Connect, health check services, and Java SE 9-based modularity.

While Lehman does agree with the programming concepts mentioned by Rahman for EE 9, he reiterates that Oracle is focused on Java EE 8 for the time being. “We’ve got to buckle down and get EE 8 out, so that is our primary focus right now,” he says.

Copyright 2017 IDG Communications. ABN 14 001 592 650. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of IDG Communications is prohibited.