📚 Learning and exploring the Helidon web server.
Lightweight. Fast. Crafted for Microservices.
Helidon is a cloud-native, open‑source set of Java libraries for writing microservices that run on a fast web core powered by Java virtual threads.
Sample Helidon SE project that includes multiple REST operations.
This repository is me learning Helidon. Specifically, I'm focusing on just the Helidon web server because this is what I'm interested in, especially the support for virtual threads starting with Helidon 4.0 which is based on the finalization of virtual threads released in Java 21.
The overall Helidon project contains many other libraries like those for database access, configuration, security, etc. There is also Helidon MP which implements Eclipse MicroProfile and is in the area of Jakarta EE. Helidon MP is described as a Spring Boot-like development experience.
I originally scaffolded this project with the Maven archetype in the Helidon SE Quickstart, but I've adapted it to my own preferences.
Follow these instructions to build and run the program:
- Pre-requisite: Java 21
- Build the program distribution
-
./gradlew installDist
-
- Run the program
-
build/install/helidon-playground/bin/helidon-playground
-
- Exercise the program via an HTTP requests
- Try the following request.
-
curl http://localhost:8080/always-lucky
- It should respond with a lucky result.
-
You rolled a 7!
- Try some other requests.
-
curl http://localhost:8080/dice-roll
-
curl http://localhost:8080/dice-roll/5
- Study the program distribution
- The set of libraries (
.jar
files) needed is nice and low when using just the Helidon web server. This is nice because in the Java ecosystem we don't have many lean options. Specifically, look in thebuild/install/helidon-playground/lib
directory. Use the following command. -
ls -lh build/install/helidon-playground/lib
- Or use the following command to sum up the sizes across all the
.jar
files. -
du -sh build/install/helidon-playground/lib
- The set of libraries (
General clean-ups, changes and things I wish to implement for this project:
- DONE Scaffold.
- DONE Convert to Gradle.
- DONE Prune down to just the web server.
- DONE Change the package name.
- DONE Replace logging with SLF4J.
- DONE Replace GreetService with something of my own creation.