ONLINE TUTORIALS

A Coding Blog by Irshad

  1. Home
  2. Articles
  3. Important New Features Planned For Helidon 2.0

Important New Features Planned For Helidon 2.0

Less than a year after the official release of Helidon 1.0, Oracle is well on its way to an official release of Helidon 2.0 scheduled for late spring 2020. Helidon 2.0.0-M1 , released in early February, and Helidon 2.0. 0-M2 , released in late March, provided the Java community with previews of important new features, including: support for messaging and responsive flows; a new command line tool, a new Web Client API for Helidon SE, GraalVM support for Helidon MP, and a new responsive database client.

Support for GraalVM, introduced with the release of Helidon 1.0.3, was only available for Helidon SE applications. Helidon MP applications were unable to take advantage of GraalVM due to the use of reflection within CDI. As one of the most requested features by the Java community, Helidon 2.0.0-M1 introduced support for converting Helidon MP applications to native executable code with GraalVM. Tomas Langer, Oracle Technical Staff Consultant, created this demo application for the Java community to preview this new functionality.

To complement the three original Helidon SE APIs – Web Server, Configuration and Security – a new API, Web Client , completes the package for Helidon SE. The web client processes HTTP requests and responses related to the specified endpoint. Just like the Web Server API, Web Client can also be configured via a file applications.yaml:

 

  • server:
  • port: 8080
  • host: 0.0.0.0
  • client:
  • connect-timeout-millis: 2000
  • read-timeout-millis: 2000
  • follow-redirects: true
  • max-redirects: 5
  • headers:
  • – name: “Accept”
  • value: [“application/json”,”text/plain”]
  • services:
  • exclude: [“some.webclient.service.Provider”]
  • config:
  • metrics:
  • – methods: [“PUT”, “POST”, “DELETE”]
  • type: COUNTER
  • name-format: “client.counter.%1$s.%2$s”
  • Let’s take a small example where an instance of the interface WebClientis created and a response defined to return plain text:
  • WebClient client = WebClient.builder()
  • .baseUri(“http://localhost”)
  • .build();
  • CompletionStage<String> response = webClient.get()
  • .path(“/endpoint”)
  • .request(String.class);
  • To modify the response to return JSON, simply create an instance of JsonProcessingand modify the definition of the variable response:
  • JsonProcessing jsonProcessing = JsonProcessing.create();
  • CompletionStage<JsonObject> response = webClient.get()
  • .path(“/endpoint”)
  • .register(jsonProcessing.newReader())
  • .request(JsonObject.class);

 

To address the challenges associated with responsive applications connecting to JDBC databases which by design are not responsive, Helidon 2.0.0-M1 introduced the new DB Client which will provide responsive database access and queries. for Helidon SE applications. DB Client supports relational databases that connect through JDBC and responsive drivers for MongoDB. This new API will provide the ability to specify database connections and write native query code to a configuration file so that database-related changes can be easily made without having to recompile the code. :

  • db:
  • source: “jdbc”
  • connection:
  • url: “jdbc:mysql://127.0.0.1:3306/pokemon?useSSL=false”
  • username: “user”
  • password: “password”
  • poolName: “mysql”
  • statements:
  • ping: “DO 0”
  • select-all-pokemons: “SELECT id, name FROM Pokemons”

 

Support for metrics, health checks, and tracing in DB Client will also be included. The Helidon team created this demo application for the Java community to preview this new functionality.

Introduced in Helidon 2.0.0-M2, developers can now create, build and run Helidon applications via the command line with the new Helidon CLI . Similar to the hot reload provided by Quarkus ( quarkus:dev), an integrated development loop monitors source files that triggers an application restart when source code changes. A separate download and installation is required. Once installed, the available command line options are shown below:

 

Asynchronous messaging is an integral part of microservices applications. To this end, stand-alone API implementations of MicroProfile, Reactive Messaging, and Reactive Streams Operators , will be introduced in version 2.0. Both APIs will be available for the Helidon SE and Helidon MP applications. However, only Reactive Messaging will be available for Helidon MP. To better align with the Helidon SE APIs, an equivalent responsive messaging API is planned in a future release. Helidon will also support Kafka for responsive messaging with additional connectors planned in a future release.

The Java community can expect some disruptive changes with the final version of Helidon 2.0. Specifically, support for Java 8 has been removed and JDK 11 will be the minimum Java version required for building Helidon applications. Some Helidon packages will also be removed in favor of the corresponding packages found in java.util , java.lang and java.io . Details of any changes to Helidon 2.0 are found in the change log .

Search Posts

Let’s Connect

Instagram
YouTube

Category

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu