days
0
-7
hours
-2
-3
minutes
-2
0
seconds
-5
-9
search
It's onward and upward from here

Project Helidon’s 0.11.0 release brings a bunch of API changes

Gabriela Motroc
microservices
© Shutterstock / Tairy Greene

Project Helidon, a set of Java libraries for writing microservices was introduced in September 2018. Although the big 1.0 release is not here yet, you should not overlook 0.11.0 as it includes a bunch of API changes (in preparation for the 1.0 release). In short, when you upgrade to 0.11.0, you will have to make changes to your application.

Project Helidon was announced less than six months ago but this new open source Java microservices framework has already started taking shape. We’re not talking about the big 1.0 release but 0.11.0 is no less important.

It should be noted that the team has made some API changes for the latest release in preparation for 1.0, which means that when you upgrade to 0.11.0, you will need to make changes to your application. You can find the list of changes here.

The list of improvements includes much more than just API refactoring so let’s have a quick look at it:

  • WebServer: Add health support in SE 287
  • MicroProfile: JWT Auth 208
  • MicroProfile: update to Fault Tolerance 1.1.3 253
  • WebServer: update Netty to 4.1.30 269
  • CDI Extensions: Add MySQL CDI integration example 284
  • Config: GenericType support for config mapping 238
  • Config: Java Beans support 197
  • Build: build on Windows 252
  • Documentation: Add Creating Docker Images guide 182
  • Documentation: add development guidelines

Helidon 0.11.0 also includes some fixes:

  • WebServer: detect and allow the default Accept header sent by HTTPURLConnection 309
  • WebServer: Ensure proper path encoding with Jersey 317
  • CDI Extensions: Add integrations modules to the bom pom 198
  • Fault Tolerance: Memory improvement 180
  • Build: fails when compiling with Java 11 225

SEE ALSO: “If you’re a Java developer and you’re writing microservices, Helidon is a great choice”

 

September 10, 2018

If you need an easier way to build microservices, you should give Project Helidon a try. Although Oracle has just open sourced this set of Java libraries, the project itself is not new, as Dmitry Kornilov, Helidon Project Lead explained in a recent blog post. Work started some time ago and the tech giant is already using it in over 10 projects.

Project Helidon (which means swallow in Greek) is meant to make the experience of building microservices more pleasant – you could, of course, use Java EE for that but when there’s a framework readily available, why not use it?

We wanted to create a lightweight set of libraries that didn’t require an application server and could be used in Java SE applications. These libraries could be used separately from each other, but when used together would provide everything a developer needs to create a microservice: configurationsecurity, and a web server.

Dmitry Kornilov

Project Helidon: Features

Simple & fast

It’s easy to use Helidon; since the project is a collection of libraries running on a fast Netty core, you won’t have to worry about extra overhead or bloat.

Reactive WebServer

Helidon Reactive WebServer is lightweight, flexible and reactive and acts as a simple to use -not to mention fast- foundation for your microservices.

Observable and resilient

If writing cloud-ready applications that integrate with Prometheus, Zipkin and Kubernetes is what you want, then Helidon is the right project for you. Did we mention that it offers support for health checks, metrics, tracing and fault tolerance?

MicroProfile support

Helidon supports MicroProfile and provides familiar APIs like JAX-RS, CDI and JSON-P/B. The MicroProfile implementation runs on Helidon Reactive WebServer.

Overview

The foundation of Helidon is composed of three elements:

  • WebServer: A programmatic HTTP API with reactive features, powered by Netty.
  • Config: A flexible configuration framework with support for multiple sources and formats
  • Security: A tool-chain to handle authentication, authorization and context propagation.

Users can choose from one of two programming models:

  • Helidon SE: a functional programming style that uses the Helidon WebServer, Config and Security APIs directly. This way, you’ll have full transparency and control. JDK is used as runtime.
  • Helidon MP is more declarative and supports the MicroProfile family of APIs. If you’re a Java EE/Jakarta EE developer, you should be familiar with this model.

Have a look at the quickstart examples before you get started with either of the two programming models.

Getting started

The easiest way to start using this set of libraries is if you use a Maven project with Java 8 (or higher version) and configure the Helidon bom-pom.

<dependencyManagement>
   <dependencies>
       <dependency>
           <groupId>io.helidon</groupId>
           <artifactId>helidon-bom</artifactId>
           <version>${helidon-version}</version>
           <type>pom</type>
           <scope>import</scope>
       </dependency>
   </dependencies>
</dependencyManagement>

The Hello World implementation for Helidon SE looks like this:

Routing routing = Routing.builder()
       .get("/hello", (req, res) -> res.send("Hello World"))
       .build();

WebServer.create(routing)
       .start();

For Helidon MP, you need to create a JAX-RS resource class to process your requests

@Path("hello")
@RequestScoped //allows us to use CDI injection
public class HelloWorld {
   @GET
   @Metered
   public String hello() {
       return "Hello World";
   }
}

After that, you’ll have to start the server with this resource:

Server.builder()
       .addResourceClass(HelloWorld.class)
       .build()
       .start();

and create beans.xml file in the src/main/resources/META-INFdirectory to trigger CDI injection in this project:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd" bean-discovery-mode="annotated">
</beans>

This would start a webserver on the default port (7001) and expose endpoint “/hello”.

What’s next for Project Helidon

The team behind this project is working on implementing the next MicroProfile version, as well as on GraalVM support, Dmitry said in the blog post.

To make sure you don’t miss any of the upcoming features, check out the website and GitHub repo and follow them on Twitter

If you want to learn more about this project, there will be some Helidon-related talks at Oracle Code One 2018 and the team will participate in the Jakarta EE/MicroProfile Community Day at EclipseCon Europe 2018.

asap

Author
Gabriela Motroc
Gabriela Motroc was editor of JAXenter.com and JAX Magazine. Before working at Software & Support Media Group, she studied International Communication Management at the Hague University of Applied Sciences.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of