Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Running Eclipse MicroProfile on IBM Cloud

DZone's Guide to

Running Eclipse MicroProfile on IBM Cloud

This quick microservices tutorial will show you how to start an Eclipse MicroProfile framework on IBM Cloud Foundry.

· Microservices Zone ·
Free Resource

The new Gartner Critical Capabilities report explains how APIs and microservices enable digital leaders to deliver better B2B, open banking and mobile projects.

In this post, I am following up on the post series about Running Eclipse MicroProfile applications in Oracle Cloud by showing how to do it in IBM Cloud Foundry, which includes runtimes for Java, Node.js, ASP.NET Core, PHP, Python, Ruby, Swift and Go.

I am using the same simple application called CloudEE Duke as in the previous posts and will show how to deploy it in the Liberty for Java™ runtime. Since the Liberty profile is it is already configured to build using the Liberty Maven Plugin, the only thing you need to do is to activate this profile:

mvn clean package -Pliberty

See the complete pom.xml to see the complete configuration.

Since CloudEE Duke is an Eclipse MicroProfile application, you need to use the packaged server deployment option in order to activate the required features of Liberty. This is done by running the command from the Liberty server directory produced by the Liberty Maven Plugin.

target/liberty/wlp/bin/server package defaultServer --include=usr

The server package command produces a .zip file that can be pushed to IBM Cloud with the Cloud Foundry CLI, as shown here:

cf push cloudee-duke -p target/liberty/wlp/usr/servers/defaultServer/defaultServer.zip

When your application is deployed, you should be able to access the hello endpoint

 https://cloudee-duke.eu-gb.mybluemix.net/hello 

Duke says Hello!

As usual, you will also have the health and metrics endpoints provided by the MicroProfile implementation.

 https://cloudee-duke.eu-gb.mybluemix.net/health

{
outcome: “UP”,
checks: [ ]
}

 https://cloudee-duke.eu-gb.mybluemix.net/metrics

# TYPE base:classloader_total_loaded_class_count counter
# HELP base:classloader_total_loaded_class_count Displays the total number of classes that have been loaded since the Java virtual machine has started execution.
base:classloader_total_loaded_class_count 10744
# TYPE base:gc_global_count counter
...

The new Gartner Critical Capabilities for Full Lifecycle API Management report shows how CA Technologies helps digital leaders with their B2B, open banking, and mobile initiatives. Get your copy from CA Technologies.

Topics:
microservices ,tutorial ,eclipse ,microprofile ,ibm cloud foundry

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}