Message Exchange Patterns

Most messaging applications use the following messaging exchange patterns:

Events generally use the publish-subscribe model.

Queries and commands use the point-to-point or request-reply model.

Publish-Subscribe

With publish-subscribe messaging, messages sent by the producer (publisher) can be processed multiple times by different consumers (subscribers). Each consumer receives its own copy of the message for processing.

Illustration depicting the concepts described in the surrounding text.

Point-to-Point

With point-to-point messaging, messages sent by the producer are processed by a single consumer.

Illustration depicting the concepts described in the surrounding text.

Non-Exclusive Consumption

You can use consumer groups to extend traditional point-to-point messaging. Consumer groups enable multiple consumers to share a queue, which is used as a single channel for messages from the producer. The receiving application can have multiple consumers, but each message is still only delivered to a single endpoint.

Illustration depicting the concepts described in the surrounding text.

Request-Reply

With request-reply messaging, applications achieve two-way communication using separate point-to-point channels: one for requests, and another for replies.

Illustration depicting the concepts described in the surrounding text.

Now that you know the basics of messaging, let's move on to What Are Event Brokers?.