Chapter 9. Message Brokers
Message brokers are often used in a distributed system, as they can help improve the reliability of communication between processes. That said, they aren’t a silver bullet for reliable communication. Understanding the basics of how brokers work can be very helpful in making sure you’re using them effectively. In addition to reviewing those basics, we’ll explore a few complementary patterns in this chapter that will further help improve the resiliency of your broker-based communication.
Message Broker Basics
A message broker is a software-based system that acts as an intermediary in interprocess communication. Rather than a client and server establishing direct communication—for example, via an HTTP connection—messages are sent to the broker, which in turn delivers them to the intended recipient.
Vendor terminology can vary, so I’ll use more generic terms here. In general, as shown in Figure 9-1, a broker sits between producers (which create messages) and consumers (which receive messages). These messages are routed via message channels.
Figure 9-1. Message broker core concepts
In general in this chapter, we’ll refer generically to the “message” as the thing that is created by a producer and then received by a consumer. A message, though, could contain many things. For example, a message could represent an event for event-driven interactions, but in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access