Monday, March 18, 2019

Messaging model


There are two primary categories of messaging models: message queuing and publish-subscribe (often referred to as pub-sub) messaging.

A message queue receives incoming messages and ensures that each message for a given topic or channel is delivered to and processed by exactly one consumer. Message queues support use cases where it is important that each message is processed (and only processed once), but it is not necessary to process messages in order.

In contrast to message queuing, publish-subscribe messaging allows multiple consumers to receive each message in a topic. Further, pub-sub messaging ensures that each consumer receives messages in a topic in the exact order in which they were received by the messaging system. Publish-subscribe messaging systems can support use cases in which multiple consumers receive each message and/or that messages are received in order by each consumer.

Technologies such as Apache ActiveMQ, Amazon SQS, IBM Websphere MQ, RabbitMQ, and RocketMQ were initially designed primarily for message queuing use cases. Other technologies such as Apache Kafka and Google Cloud Pub/Sub were designed primarily to support publish-subscribe use cases. Other, often newer solutions such as Apache Pulsar provide support for both message queuing and pub-sub messaging.

Apache Pulsar combines high-performance streaming (which Apache Kafka pursues) and flexible traditional queuing (which RabbitMQ pursues) into a unified messaging model and API. Pulsar gives you one system for both streaming and queuing, with the same high performance, using a unified API.

Streaming is strictly ordered or exclusive messaging. With streaming messaging, there is always only one consumer consuming the messaging channel. The consumer receives the messages dispatched from the channel in the exact order in which they were written.

No comments:

Post a Comment