Messaging systems
In a data-driven system, messages contain a unit of information or instructions for a unit of work. Passing these messages from one system to another allows for inter-process communication (IPC), or rather, inter-service communication. This allows for the decoupling of various services and forms the basis for event-driven systems, which we discussed in Chapter 1. Every message would have a producer creating a message and sending it to the messaging system and a consumer who would pick it up and process it.
In this section, we are going to discuss messaging systems in more detail, how various models of communication differ, and how and when to use them. In messaging systems, there are two architecture patterns—message queuing and pub-sub.
Message queues
A queue is a sequence of items waiting to be processed in the order they arrive. This is similar to the typical first in, first out (FIFO) queues in software design. The first item that arrives in the...