Message Exchange Architectures and Routing Patterns
This article explains the fundamental message exchange architectures—such as publish‑subscribe, fan‑out, unidirectional and bidirectional streaming, unicast, broadcast, multicast, and anycast—and how they are used in systems like Redis, Kafka, RabbitMQ, ZeroMQ and IBM MQ to simplify communication between architects and developers.
This article introduces the basic patterns of message exchange architectures and routing methods used in technologies such as Redis, Apache Kafka, RabbitMQ, ZeroMQ, and IBM MQ, and shows how these patterns can streamline interactions between architects and developers.
Conceptually, a message is an information exchange between a sender and one or more receivers, and message exchange has been a core part of programming and architecture since the mainframe era.
Over the years, many message transmission patterns have emerged. The article divides them into two parts: "Message Exchange Architecture" (the structure that moves messages between sender and receiver) and "Routing" (the logic that directs messages).
1 Message Exchange Architecture
This section describes mechanisms for moving messages between sender and receiver.
Publish‑Subscribe
In the Pub‑Sub pattern, publishers send messages to a broker’s topic (or exchange in RabbitMQ, topic in Kafka). Subscribers bind to the topic and receive messages asynchronously.
Pub‑Sub is well‑suited for broadcasting event information to interested parties and is simple: messages are produced, routed by the broker, and consumed asynchronously.
Fan‑out
Similar to Pub‑Sub, but every subscriber bound to a topic receives a copy of each message, effectively “fanning out” the message to all interested parties.
Twitter is a classic example of fan‑out: a tweet is delivered to all followers.
Unidirectional Streaming
In this pattern the sender continuously streams data to the receiver, e.g., a mobile device sending GPS updates to a server.
Sometimes the sender connects to a broker that forwards the stream to subscribed receivers; Apache Kafka is an example of a broker that supports this pattern.
Bidirectional Streaming
Both sender and receiver continuously exchange streams, as illustrated by gRPC over HTTP/2, which maintains a persistent connection for two‑way data flow.
2 Routing
This section covers routing methods that determine how messages travel from sender to receiver, including unicast, broadcast, multicast, and anycast.
Unicast
Messages are routed from sender to a single, specific receiver, exemplified by the HTTP request/response model.
Broadcast
The sender delivers the message to all receivers on the network; ARP is a classic broadcast example.
Multicast
Messages are sent to a specific group of receivers, such as IPTV streams delivered to a channel of subscribers.
Anycast
Routers deliver the message to any one receiver that satisfies certain criteria, commonly used by Content Delivery Networks (CDNs) to route users to the nearest server.
3 Summary
Developers and architects familiar with messaging in application development will recognize most of these patterns; some names may be new, but the implementations are recognizable. Using common names for these patterns enables concise communication during design discussions and helps align teams on architectural decisions.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
IT Architects Alliance
Discussion and exchange on system, internet, large‑scale distributed, high‑availability, and high‑performance architectures, as well as big data, machine learning, AI, and architecture adjustments with internet technologies. Includes real‑world large‑scale architecture case studies. Open to architects who have ideas and enjoy sharing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
