Skip to content

mia-platform-marketplace/Helidon-Hello-World-Example

Repository files navigation

Helidon-Hello-World-Example

Build Status

⚠️ Warning: This repository is no longer maintained.

This walkthrough will explain you how to correctly create a microservice in Helidon that returns an hello message from the DevOps Console.

Create a microservice

In order to do so, access to Mia-Platform DevOps Console, create a new project and go to the Design area.
From the Design area of your project select Microservices and then create a new one, you have now reached Mia-Platform Marketplace!
In the marketplace you will see a set of Examples and Templates that can be used to set-up microservices with a predefined and tested function.

For this walkthrough select the following example: Helidon Hello World. Give your microservice the name you prefer, in this walkthrough we'll refer to it with the following name: helidon-hello. Then, fill the other required fields and confirm that you want to create a microservice.
A more detailed description on how to create a Microservice can be found in Microservice from template - Get started section of Mia-Platform documentation.

⚠️ Please verify CPU and memory limits, for Java applications using Helidon we recommend at least:

  • Memory: minimum 100Mi, maximum 300Mi
  • CPU: minimum 10m, maximum 500m

Resources and Performance

By running autocannon on the /hello route, we obtain the following performance:

autocannon http://localhost:3000/hello Running 10s test @ http://localhost:3000/hello 10 connections

Average Latency

Non-native image has 109.82 ms average latency, while native image has 58.12 ms average latency.

Average Req/Sec

Non-native image handles 90.4 req/sec on average, while native image handles 170.2 req/sec on average.

Average Bytes/Sec

Non-native image handles 14.3 bytes/sec on average, while native image handles 26.9 bytes/sec on average.

Total handled requests

Non-native image handles 904 request in 10.05s consuming 66 mCPU and 75 Mi of memory, while native image handles 2k requests in 10.03s consuming 5 mCPU and 32 Mi of memory.

Therefore, the native image attends about twice the number of requests while consuming much less memory and cpu and having lower latency.

Expose an endpoint to your microservice

In order to access to your new microservice it is necessary to create an endpoint that targets it.
In particular, in this walkthrough you will create an endpoint to your microservice helidon-hello. To do so, from the Design area of your project select Endpoints and then create a new endpoint. Now you need to choose a path for your endpoint and to connect this endpoint to your microservice. Give to your endpoint the following path: /hello. Then, specify that you want to connect your endpoint to a microservice and, finally, select helidon-hello.
Step 3 of Microservice from template - Get started section of Mia-Platform documentation will explain in detail how to create an endpoint from the DevOps Console.

Save your changes

After having created an endpoint to your microservice you should save the changes that you have done to your project in the DevOps console.
Remember to choose a meaningful title for your commit (e.g "created service helidon_hello"). After some seconds you will be prompted with a popup message which confirms that you have successfully saved all your changes.
Step 4 of Microservice from template - Get started section of Mia-Platform documentation will explain how to correctly save the changes you have made on your project in the DevOps console.

Deploy

Once all the changes that you have made are saved, you should deploy your project through the DevOps Console. Go to the Deploy area of the DevOps Console.
Once here select the environment and the branch you have worked on and confirm your choices clicking on the deploy button. When the deploy process is finished you will receveive a pop-up message that will inform you.
Step 5 of Microservice from template - Get started section of Mia-Platform documentation will explain in detail how to correctly deploy your project.

Try it

Now, if you launch the following command on your terminal (remember to replace <YOUR_PROJECT_HOST> with the real host of your project):

curl <YOUR_PROJECT_HOST>/hello

you should see the following message:

{"message":"Hello World!"}

or if you want to try with a specific name:

curl <YOUR_PROJECT_HOST>/hello/Joe

you should see the following message:

{"message":"Hello Joe!"}

Congratulations! You have successfully learnt how to use our Helidon Hello World Example on the DevOps Console!

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •