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:
- Debugger for Java
With that extension, I configured to attach the debugging of OpenLiberty on port ‘7777’ - Maven for java
and more …
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
ororg.microshed.boost:boost-maven-plugin
in thepom.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.
- To build the Java Microservice application with maven, I configured to use the OpenLiberty maven development tools.
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