This is a queue that stores messages. The goal here is work distribution where one message is handled by only one consumer from a group. I.e a single message queue is handled by a single consumer (which can have multiple workers).
Messages decouple the publisher and the consumer (Publisher Subscriber Model) which is good and let non-critical work be handled without immediacy which leads to more reliable systems under load.
- As such you get cool results
- Consumers can still pull messages from the queue if the producer is down
- The producer can still produce to the queue if the consumer is down
- A priority queue can be used for more important messages
Data is stored on disk so data loss is not an issue here. Some MQ’s can also participate in Atomic Commits (2PC).
Info
You can add more workers to increase throughput.
Multiple Consumers
- Load balancing shares the work of consumer a topic among consumers
- Fan-out delivers each message to multiple consumers
Brokers require ACKs from consumers to know when a message can be removed. We could have the case where the message was processed but the ACK was lost, where here, we need to make use of Atomic Commits.