How to achieve Message Priority using Quorum Queues? #9516
Replies: 2 comments
-
You have other options in this scenario, as well:
|
Beta Was this translation helpful? Give feedback.
-
Or use multiple consumers. Very often people reach for priority queues not because they absolutely must process message A before B but because they don't want a sequence of messages of type A to block processing of B for too long. Multiple consumers on separate queues give you that without any polling or passive declaration dances. You can also use an app-local priority queue where your consumers will store the deliveries, and process them concurrently however you like. Arguably this would be much easier to reason about if instead of N queues you consider using N streams. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My use case requires that RabbitMQ messages are processed (consumed) according to their priority. That is, high priority messages will be processed before medium priority, and medium before low.
According to the RabbitMQ documentation, this is possible with Quorum Queues using a queue for each priority.
Specifically, the RabbitMQ documentation states:
However, nothing more is said about how to implement this at the consumer level.
The only idea I have is to utilize the Rabbit "Polling" API to poll each queue in order, and only move on to a lower priority queue when no messages are returned; however, the documentation also says the Polling API is "highly inefficient and should be avoided in most cases".
Is there another approach to achieve message priorities using Quorum Queues?
Beta Was this translation helpful? Give feedback.
All reactions