Part 1: Developer environment installation

Oracle made some great releases last year and now in early 2024 it is a perfect time to put them in use for a real-life software project. These releases include:

  • Helidon 4
  • MicroTX v. 23.4.1, a coordinator for microservices distributed transactions
  • VS Code extensions for OCI DevOps (OCI stands for Oracle Cloud Infrastructure) as part of the Graal Cloud Native (GCN)

While Oracle MicroTX ships with some nice examples for Helidon, Springboot and NodeJS in form of a Hotel, Air flight and Travel booking application I wanted to create something a bit more tangible for a regular developer, like let’s say a small business or organization that could easily benefit from this technology for a real-life application.

Oracle made some great releases last year and now in early 2024 it is a perfect time to put them in use for a real-life software project. These are all free for developer use and running applications on them in OCI for dev and test (for Enterprise use there is a licensed version of MicroTX available).

I was discussing this objective with my colleague Marta Tolosa and as she was visiting her local gym she came up with this great idea of making an app for gym users and instructors to meet at.

You know, at least at her local gym the instructor led sessions like Yoga seem to be a bit difficult to sign up to since the sessions maybe under and overbooked and cancelled suddenly due to under booking and people not attending eventually to sessions that is not good business for the Yoga instructors to have.

If you think about it, it is not just the Yoga classes and can be applied basically anywhere that require a sort of a booking in advance, ideally with a pre or a post payment, and a desired number of attendees to the event. Of course in case of cancellations the money has to be returned when applying pre payments or charged after the event when applying post payments and this brings the transactionality into the picture. Examples of such other use cases could be:

  • A restaurant chef having private cooking lessons for a group a people
  • A band having a play session at the local club
  • An artist having a public painting class

Based on this great idea for a “Gymapp”, I sketched up this high-level architecture below of a few microservices with Long Running Actions (LRA) pattern of the MicroTX.

Unlike traditional, often database related transactions LRAs are distributed transactions that can spawn over multiple microservices in a system and last hours or days or even months in time depending on the use cases.

Gymapp microservices architecture

Here, Gymuser is the microservice for gym users to attend to available classes provided by Gym Instructors in their Gyminstructor microservice. Payment microservice could be something internal or external and for our Gympapp I chose to go with PayPal® that is globally used and it would not have to be implemented by ourselves.

Both microservices, Gymuser and Gyminstructor, would also include an easily customizable and responsive UI for mobile and desktop besides the REST APIs for the backend and their own database.

Unlike traditional often database related transactions LRAs are distributed transactions that can spawn over multiple microservices in a system and last hours or days or even months in time depending on the use cases.

A good place to start any microservices project in Java with Helidon 4 is to go to helidon.io and generate a Helidon microprofile (MP) sample project with desired features (arhcetypes) and then download it to your local development environment. Alternatively, you can download and install Helidon cli to generate the starter project.

Helidon 4 programs require Java JDK 21 to run which also needs to be downloaded and installed to the local dev. In order to build a Helidon 4 project maven is also required and needs to be downloaded and installed on the local dev, too.

A very nice part of the Helidon cli is the Developer loop that makes development fast and easy by enabling development time compilation that happens automatically after every code change/save. See the demo video about it on Helidon cli page.

I can highly recommend that for your development and I’m using it constantly for Gymapp application or any other microservices project.

BTW, I was somewhat familiar with Springboot development and found learning and using Helidon easy. If you are interested in making the jump to Helidon, it should be rather effortless.

Helidon is well supported on OCI and it’s performance should be very good with the new virtual threads and other great features. You can also download the Helidon source from GitHub.

To get going with Gymapp I generated a starter project with the following Helidon 4 features:

  • Flavor: Helidon MP, with Java annotations
  • Application Type: Custom
  • Media Support: Jackson — I think any other option would do just fine
  • Security: None — I added this part later in my project since I wasn’t exactly sure what I want at this point
  • Database: Oracle — I was planning to use Oracle public Docker container image XE database so this was the best choice for me. I also selected Hibernate for the JPA persistence and object relational mapping.
  • Extra: None at this point
  • Observability: None at this point
  • Packaging and Deployment: None at this point — I was planning to use VSIX for VS Code and OCI DevOps CI/CD instead

For your own project you may naturally choose the features you think will best fit for your project.

To start developing the Gymapp Gymuser Helidon microservice I used Oracle open source extensions for VS Code and OCI DevOps (VSIX is short) that can be installed directly for free from VS Code:

Installing OCI DevOps tools extension in VS Code

After VSIX installation I opened the downloaded and unzipped Helidon 4 starter project that also shows the OCI DevOps panel in the VS Code:

OCI DEVOPS extension panel in VS Code after project creation

We’ll be using that OCI DEVOPS panel later when we build and deploy the Gymapp microservices to Kubernetes in OCI, but for a little while we’ll let that be as is.

VSIX source is also available in Oracle’s GitHub in case you are interested in participating in it’s development.

BTW, it is possible to run the Helidon Dev remotely on an OCI VM (like the always-free with OCI Linux 8 Developer Image) using Microsoft’s VS Code Remote SSH extension so that the dev env feels like local but everything runs on OCI. I’ve used this setup successfully and both options, local and remote, are perfectly fine to be productive.

Now we are ready to start developing the Gymapp microservices locally with Helidon Dev and VS Code. I will cover that in the Part 2.

--

--