chapter twenty one

21 Asynchronous communication with a message queue

 

This is the final full chapter of the book, and it introduces a new way for the components of a system to communicate: sending and receiving messages using a queue. Message queues have been around for a very long time - they're a way of decoupling components so instead of making a direct connection to communicate with each other, they send messages to the queue. The queue can deliver messages to one or many recipients, and that adds a lot of flexibility to your architecture. In this chapter we'll focus on two scenarios which are enabled when you add a message queue to your application: improving system performance and scalability, and adding new features with zero downtime. We'll use two modern message queues which run very nicely in Docker: Redis and NATS.

21.1  What is asynchronous messaging?

21.2  Using a cloud-native message queue

21.3  Consuming and handling messages

21.4  Adding new features with message handlers

21.5  Understanding async messaging patterns

21.6  Lab