Architectural Messaging Patterns: Exchange Architectures and Routing Methods
This article explains the fundamental messaging exchange architectures such as Pub‑Sub, Fanout, Unidirectional and Bidirectional streaming, and the routing patterns including Unicast, Broadcast, Multicast and Anycast, illustrating how they are used in systems like Redis, Kafka, RabbitMQ and IBM MQ to simplify communication between producers and consumers.
This article introduces the basic messaging exchange architectures and routing methods employed by 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 represents a single information exchange between a sender and one or more receivers, a core component of computer programming and system design since the mainframe era.
The patterns are divided into two parts: the first part, "Message Exchange Architecture," describes the structures that move messages between senders and receivers; the second part, "Routing," covers the logical methods that deliver messages from senders to receivers.
1. Message Exchange Architecture
These patterns focus on the mechanisms for transporting messages.
Pub‑Sub
The Publish‑Subscribe (Pub‑Sub) pattern has publishers send messages to a broker’s topic (or exchange in RabbitMQ, topic in Kafka). Subscribers bind to the topic and receive messages asynchronously.
Fanout
Similar to Pub‑Sub, Fanout delivers a copy of each message to all subscribers bound to a given topic, effectively broadcasting the message to every interested party (e.g., Twitter).
Unidirectional Streaming
In this pattern the sender continuously streams data to the receiver, often via a broker that forwards the stream through a topic‑like inbox (e.g., Apache Kafka).
Bidirectional Streaming
Bidirectional streaming allows continuous two‑way message flow between sender and receiver, as exemplified by gRPC over HTTP/2.
2. Routing
These patterns describe how messages are routed between endpoints.
Unicast
Messages are routed from the 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 example.
Multicast
Messages are sent to a defined group of receivers, such as IPTV delivering streams to a set of subscribed devices.
Anycast
Routers forward the message to the nearest receiver that satisfies certain criteria, a technique commonly used by Content Delivery Networks (CDNs).
3. Summary
Architects and developers familiar with messaging will recognize many of these patterns; naming them consistently helps teams discuss solutions efficiently and reach consensus on the most suitable pattern for a given business requirement.
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.
Top Architect
Top Architect focuses on sharing practical architecture knowledge, covering enterprise, system, website, large‑scale distributed, and high‑availability architectures, plus architecture adjustments using internet technologies. We welcome idea‑driven, sharing‑oriented architects to exchange and learn together.
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.
