[rabbitmq-discuss] Message priority in RabbitMQ

Michael Klishin mklishin at gopivotal.com
Wed Mar 5 07:39:12 GMT 2014


On 5 Mar 2014, at 09:25, Arun Shankar <iamarun.shankar at gmail.com> wrote:

> Does RabbitMQ supports message priority? I have a requirement where messages with high priority are to be executed first before the messages with low priority sitting in front of the queue.

No.

> If message priority is not available, can someone please suggest me a better solution using RabbitMQ to achieve this?

You can use two queues (“low” and “high” priorities), consume from both of them and store them in a local
(in memory) collection that provides the ordering semantics you need, then process them off the collection.

If your requirement were “low priority messages should not block high priority messages from being processed”, simply
using 2 queues and 2 (sets of) consumers may be sufficient in practice.

HTH.

MK

Software Engineer, Pivotal/RabbitMQ




More information about the rabbitmq-discuss mailing list