Chapter 3. Building Reactive Microservices

In this chapter, we will build our first microservices with Vert.x. As most microservice systems use HTTP interactions, we are going to start with HTTP microservices. But because systems consist of multiple communicating microservices, we will build another microservice that consumes the first one. Then, we will demonstrate why such a design does not completely embrace reactive microservices. Finally, we will implement message-based microservices to see how messaging improves the reactiveness.

First Microservices

In this chapter we are going to implement the same set of microservices twice. The first microservice exposes a hello service that we will call hello microservice. Another consumes this service twice (concurrently). The consumer will be called hello consumer microservice. This small system illustrates not only how a service is served, but also how it is consumed. On the left side of Figure 3-1, the microservices are using HTTP interactions. The hello consumer microservice uses an HTTP client to invoke the hello microservice. On the right side, the hello consumer microservice uses messages to interact with the hello microservice. This difference impacts the reactiveness of the system.

brmj 0301
Figure 3-1. The microservices implemented in this chapter using HTTP and message-based interactions

In the previous chapter, we saw two different ...

Get Building Reactive Microservices in Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.