Queues
A queue is a message queue destination.
Use queues when messages should accumulate until they are consumed. Each message is delivered to one consumer and acknowledged after processing.
How Queues Receive Messages
A queue receives messages through a binding to one or more topic filters.
When a producer publishes a message to a matching topic, FlowMQ places a copy of the message in the queue.
FIFO Delivery
Queues use a first-in, first-out delivery model. Messages are consumed from the queue in the order they are enqueued.
Retries, redelivery, and concurrent processing can affect the order in which processing completes. Applications that require strict end-to-end ordering should design their consumers accordingly.
Acknowledgment
Queue consumers acknowledge messages after processing.
If a consumer does not acknowledge a message, FlowMQ can deliver it again. Applications should make queue handlers idempotent when duplicate processing is possible.
A queue can be consumed by a single consumer or by multiple consumers. In both cases, each queued message is delivered to one consumer, not fanned out to all consumers.
When to Use Queues
Use a queue for:
- Background jobs
- Worker pools
- Task distribution
- Asynchronous request processing
Do not use a queue when every consumer must receive every message. Use a stream or subscription instead.