Microservices

In order for a deployable unit of code to be qualified as a microservice, it has to possess the following characteristics:

That said, let's look over the field of toolkits for microservice implementation. One can definitely write microservices from scratch, but before doing that, it is always worth looking at what is out there already, even if you find that nothing fits your particular needs.

The two most popular toolkits are Spring Boot (https://projects.spring.io/spring-boot) and raw J2EE. The J2EE community founded the MicroProfile (https://microprofile.io) initiative, with a declared goal of optimizing Enterprise Java for a microservices architecture. KumuluzEE (https://ee.kumuluz.com) is a lightweight open source microservice framework, compliant with MicroProfile.

A list of some other frameworks, libraries, and toolkits includes the following (in alphabetical order):

All of the frameworks, libraries, and toolkits listed support HTTP/JSON communication between microservices. Some of them also have an additional way of sending messages. If they do not, any lightweight messaging system can be used. We mention it here because, as you may recall, message-driven asynchronous processing is a foundation for the elasticity, responsiveness, and resilience of a reactive system composed of microservices.

To demonstrate the process of microservice building, we will use Vert.x, an event-driven non-blocking lightweight polyglot toolkit (components can be written in Java, JavaScript, Groovy, Ruby, Scala, Kotlin, or Ceylon). It supports an asynchronous programming model and a distributed event bus that reaches into in-browser JavaScript, allowing for the creation of real-time web applications.