{{announcement.body}}
{{announcement.title}}

Building Microservices With Oracle Helidon

DZone 's Guide to

Building Microservices With Oracle Helidon

Oracle Helidon is a collection of Java libraries for writing microservices that run on a fast web core powered by Netty.

· Microservices Zone ·
Free Resource

Oracle Helidon is a collection of Java libraries for writing microservices that run on a fast web core powered by Netty.

For initial development, we are leveraging a JAX-RS based microservice-starter application similar to implementation using Red Hat Quarkus.

More about the lifecycle is explained below.

You may also like: Building Microservices With Redis

Packaging

Oracle Helidon uses a maven dependency plugin for packaging the application which put all the runtime dependencies into the libs folder.

Java
 







It also supports uber jar creation with some limitations using the maven shade plugin.

Java
 




xxxxxxxxxx
1
23


 
1
<plugin>
2
 <groupId>org.apache.maven.plugins</groupId>
3
 <artifactId>maven-shade-plugin</artifactId>
4
   <executions>
5
     <execution>
6
     <phase>package</phase>
7
     <goals>
8
       <goal>shade</goal>
9
     </goals>
10
       <configuration>
11
         <transformers>
12
           <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
13
             <mainClass>${mainClass}</mainClass>
14
           </transformer>
15
           <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
16
             <resource>META-INF/beans.xml</resource>
17
           </transformer>
18
         <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
19
       </transformers>
20
     </configuration>
21
   </execution>
22
 </executions>
23
</plugin>



Deployment

Oracle Helidon is full microprofile implementation and supports JAXRS out of the box but requires some exclusion which currently does not support uber jar creation.

Java
 




xxxxxxxxxx
1
22


 
1
<dependency>
2
 <groupId>io.helidon.microprofile.bundles</groupId>
3
 <artifactId>helidon-microprofile</artifactId>
4
 <exclusions>
5
   <exclusion>
6
     <groupId>io.helidon.microprofile.tracing</groupId>
7
     <artifactId>helidon-microprofile-tracing</artifactId>
8
   </exclusion>
9
   <exclusion>
10
     <groupId>io.helidon.microprofile.metrics</groupId>
11
     <artifactId>helidon-microprofile-metrics2</artifactId>
12
   </exclusion>
13
   <exclusion>
14
     <groupId>io.helidon.microprofile.jwt</groupId>
15
     <artifactId>helidon-microprofile-jwt-auth-cdi</artifactId>
16
   </exclusion>
17
   <exclusion>
18
     <groupId>io.helidon.microprofile</groupId>
19
     <artifactId>helidon-microprofile-fault-tolerance</artifactId>
20
   </exclusion>
21
 </exclusions>
22
</dependency>



Launcher

Oracle Helidon provides built-in launcher with beans and logging configuration support which can directly run and packaged within the jar.

Java


Dev

Java


Prod

Java


The complete example can found here at microservice-starter-helidon.


Further Reading

Tools and Techniques for Building Microservices

Spring Boot Microservices: Building a Microservices Application Using Spring Boot

Building Microservices Through Event-Driven Architecture, Part 1: Application-Specific Business Rules

Topics:
helidon ,java ,microservice ,microservices ,oracle

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}