9 Quarkus messaging

 

This chapter covers

  • Learning about MicroProfile Reactive Messaging
  • Defining Reactive systems
  • Utilizing reactive messaging in Quarkus
  • Exploring Kafka and RabbitMQ broker integrations in Quarkus
  • Reactive messaging in car rental

In the previous chapter, we learned what reactive programming is and why it can benefit user applications. We evaluated reactive programming as a great alternative for applications that have a high resources demand, because they can effectively scale to higher numbers of concurrent requests. But in microservices, where the application consists of many isolated service applications, we also often need a way to let the applications communicate asynchronously without blocking threads while we wait for responses and without coupling the applications together too closely. This is where Quarkus messaging comes in.

In this chapter, we learn about the MicroProfile Reactive Messaging specification that was created with the intent to propagate asynchronous messages between services. This standard provides a simple, unified API that we will also utilize in a newly created Billing service in our car rental application.

9.1 Car rental messaging integrations

9.2 Reactive systems

9.3 MicroProfile Reactive Messaging

9.3.1 Synchronous vs. asynchronous distributed communication

9.3.2 Reactive messaging API

9.3.3 Message acknowledgments

9.3.4 Integrating imperative code with reactive messaging

9.4 Introducing messaging in Reservation

9.5 Connectors

9.5.1 What is a connector?

9.5.2 Connector configuration

9.6 Quarkus messaging with Kafka connector

9.6.1 Kafka integration in the Rental service

9.6.2 Testing messaging with Kafka

9.7 Quarkus messaging with RabbitMQ

9.7.1 Testing messaging with RabbitMQ

9.8 Car rental Billing service

9.8.1 Messaging in the Billing service

9.8.2 Consuming RabbitMQ messages from the Reservation service

9.8.3 Producing confirmations to the Rental service

9.8.4 Rental service invoice confirmations