Create one Java Microservice with OpenLiberty and MicroProfile – made for beginners

Today I created a YouTube video, where I developed one Microservice. The level of content of that video is for beginners. The video was “live” recorded and I made some minimal editing and the video takes 18 min.
The recoding is related to Java Microservices with MicroProfile and OpenLiberty in Visual Studio Code . The source code is available in the open sourced Cloud Native Starter GitHub project.

Check it out:

Maybe you are interested, how did I setup the IDE and the Project? … here are the basics.

The Visual Studio Code configuration

1. Java configuration

I used Visual Studio Code with the Java Extension Pack . That extension includes also following extensions:

2. OpenLiberty configuration

In addition I utilized the Liberty Dev mode Visual Studio Code extension, which helps to start OpenLiberty very easily. You can just start the server with a right click in the development mode.

Here is an extract of the Liberty Dev description:

“The extension will detect your Liberty Maven project if it detects the io.openliberty.tools:liberty-maven-plugin or org.microshed.boost:boost-maven-plugin in the pom.xml. Through the Liberty Dev Dashboard explorer on the side bar, you can start, stop, or interact with dev mode on all available Liberty dev projects in your workspace.”

Source liberty dev 

3. Code snippets

I also created some code snippets in Visual Studio Code. It is very easy to configure.

The Project configuration

Here are the relevant parts of the pom file for the Java project.

  • Dependency to MicroProfile
    That dependency contains all we need to implement a RESTFul simple Microservice with JSON data exchange.

one-service-pom-01

one-service-pom-02

I hope this was useful for you and let’s see what’s next?

Greetings,

Thomas

PS: You can try out Cloud Foundry Apps or Kubernetes on IBM Cloud. By the way, you can use the IBM Cloud for free, if you simply create an IBM Lite account. Here you only need an e-mail address.

#ibmdeveloper, #ibmcloud, #cloudnativestarter, #cns, #microprofile, #youtube, #microservices, #java, #vscode,  #openliberty

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.