beawolf - Fotolia

Get started Bring yourself up to speed with our introductory content.

These tools help build microservices in Java

Depending on the mission, developers need to align their tool choices with one of two paths for Java microservices. Here's what you need to know.

To build microservices in Java, there are two basic paths. The first path uses microservices as part of a Java-based web front-end development process where the microservices are adjuncts to web server behavior. The second approach uses Java to develop microservices that integrate with applications as components.

The front-end and back-end approach each require different sets of tooling to accomplish their goals. Java developers must understand both and explore the tools that each of these strategies require to determine the best approach.

Tools for the front-end approach

Many Java microservices developers who work on front-end applications base their work on the Maven and Spring Boot tools. These tools, when combined, create an environment that can be used for builds and deployment. Tools like Tomcat, Jetty, Netty, Grizzly and Undertow can also help developers build microservices for Java; however, these options work best when Java development tightly integrates with web servers and application front ends.

For front-end microservices, the common theme is integration of microservices and web servers. By design, all the tools associated with front-end microservices manage web activity and microservices within a common framework. The microservices become scalable elements of web server support for applications. This approach works as long as everything is based on a web server.

Spring Cloud lets you enable Spring Boot Java microservices through the cloud. It includes open source scaling and monitoring tools, and it is the right answer for Java developers who want to build web-based front ends that use microservices.

Traditional deployment starts with an API gateway

Deploying Java microservices to a traditional hosting environment starts with an API gateway. An API gateway uses a brokerage technique similar to the popular storefront design pattern. It accepts a single broad request from a user and then decomposes that request into separate microservice calls. However, a microservice API broker must also load balance among instances of scalable microservices. It will likely have to integrate with other technology to provide that scaling.

You can build an API gateway with JVM tools like JBoss Undertow, or you can build them outside JVM with node.js or Nginx. You can also integrate storefront logic with a workflow distribution fabric like Istio or with a data plane fabric like Juke.

However, storefront designs that involve asynchronous callback on service completion create complex code when there are dependencies among related microservices. When you write code using declarative abstractions -- as in reactive programming -- it will untangle your dependency relationships. Java 8 provides tools for this, and RxJava is available for both JVM and node.js.

Tools for the back-end approach

There is another microservices evolution that componentizes back-end portions of applications and doesn't integrate with web servers at all. Java microservices are suited for this approach, but developers will need to look less at the web side and instead focus on general componentization techniques.

For generalized microservices development, Java code is as portable as the Java virtual machine (JVM). This means you can adapt microservices in Java to bare metal, virtual machines (VMs) or containers without changing the code. However, this means you'll lose the automatic, integrated scaling and deployment provided by Spring Boot and Spring Cloud.

This becomes important in testing because the developer must test in the same environment in which deployment takes place. Java developers who take this approach must consider how they will host the microservices and determine the requisite orchestration tools.

Dig Deeper on Application development and management

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

What tools best fit your microservice strategy for Java development?
Cancel

-ADS BY GOOGLE

SearchSoftwareQuality

SearchAWS

SearchCloudComputing

TheServerSide.com

Close