Developing and Debugging Microservices With Java
We explore how the Microclimate framework can make it easier to build and debug microservices in the Java language. Read on to get started!
Join the DZone community and get the full member experience.Join For Free
kubernetes has become the de facto standard for deploying and managing containerized applications in public, private, and hybrid cloud environments. while kubernetes is really powerful, it's not the easiest way for developers to deploy applications.
to make developers more productive, several technologies have emerged to make creations and deployments of applications on kubernetes easier, for example, cloud foundry, which can be run on kubernetes , and knative .
another technology is microclimate . here is the description from the microclimate home page:
microclimate is an end-to-end development environment that lets you rapidly create, edit, and deploy applications. applications are run in containers from day one and can be delivered into production on kubernetes through an automated devops pipeline using jenkins.
in the easiest case, developers can write microservices locally and push code via git, which triggers pipelines that generate the images and run the containers. this works when running locally, it is supported for ibm cloud private and with scripts and helm charts microservices can be also deployed to other kubernetes platforms like ibm cloud .
let's take a closer look at how to use microclimate locally . via the web application, developers can create new projects in java, node.js, python, swift, and go.
for java projects, you can choose between microprofile/java ee, spring, and lagom. in my example , i've used microprofile .
the following screenshot shows the overview page of the project. i've put the code on github . whenever the code changes, pipelines can be triggered automatically.
for smaller changes, microclimate comes with an integrated text editor in the web application.
in addition to the build logs and application logs, application metrics are displayed, too (garbage collection time, http throughput, heap, http incoming requests, cpu):
in order to run microclimate, you need docker, since everything is containerized: microclimate itself, as well as the containers running your microservices. i like this concept a lot since it allows working in the same containers locally, which are later deployed on kubernetes. this minimizes the risk to run into issues because of different environments.
for eclipse and visual studio code, there are plugins to connect to microclimate. this allows running and debugging your application code directly from the development environments. this is very similar to what i blogged about ibm cloud functions . the following screenshot shows the debugger in visual studio code accessing the running code in a container.
you can also do changes from the ides and run the changed code without having to restart containers or application servers manually!
check out the microclimate documentation to learn more.
Published at DZone with permission of Niklas Heidloff, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
How to Load Cypress Chrome Extension
Which Is Better for IoT: Azure RTOS or FreeRTOS?
SRE vs. DevOps
Microservices: Quarkus vs Spring Boot