Microservice is the new architectural practice in the Cloud-native application development. This will make sure quick and easy shipment to the customers. Development tools and frameworks are released frequently than before to enable the whole eco-system moving so fast.
Helidon
Helidon is the new addition in the microservice development race for Java developers. It is an open-source project developed by Oracle. When I came across this framework, I wanted to give a try for my next microservice development. The moment I started looking into their documentation, I couldn’t stop reading further. So I wanted to give a shot to get my initial feelings about the framework. My first feeling was fantastic! This is not simply because of offering nice tooling and the latest technology. But this is so easy to get started and get things done in zero time. I mean ZERO time.
Create project skeleton
Execute the below archetype to get the skeleton code. Please make note that before executing the command you should have Java and Maven in your classpath.
mvn archetype:generate -DinteractiveMode=false \
-DarchetypeGroupId=io.helidon.archetypes \
-DarchetypeArtifactId=helidon-quickstart-mp \
-DarchetypeVersion=1.3.1 \
-DgroupId=com.hustlebar \
-DartifactId=dailyapi \
-Dpackage=com.hustlebar.dailyapi
Run project
Compile and run the project using the following command,
Compile:
> mvn package
Run application:
> java -jar target\dailyapi.jar
Access application
Access the application using http://localhost:8080/greet
There are few other default endpoints are created in our skeleton code. But the most important point here is, you will get a lot more capability out of the box due to the Microprofile.
Paths | Explanation |
/health | To get the health of the application |
/openapi | To generate the Open API specification document |
/metrics | To get the metrics of the application |
All the above endpoints are supported out of the box without even writing a single line of code by us.
The whole exercise is completed within 5 minutes of my time. The first experience with the Helidon framework is so awesome. I will keep exploring the framework further and share my thoughts in the coming weeks!
{ happy coding }
NOTE: I am NOT employed at Oracle and I am NOT promoting this framework!