[rabbitmq-discuss] Possible bug in Priority Queue plugin
steven.blanc at avid.com
Wed Jul 9 12:58:28 BST 2014
Thank you. As always, you guys have the answers.
I am making sure messages back up in the queue by producing with no
delay and consuming with a 1 second delay between calls to BasicConumeMessage.
Once I set the prefetch count to 1 and properly ACK'd all the messages
the behavior was as expected/desired.
From: Simon MacMullen [mailto:simon at rabbitmq.com]
Sent: Wednesday, July 09, 2014 5:10 AM
To: Legacy list about RabbitMQ; Steven Blanc
Subject: Re: [rabbitmq-discuss] Possible bug in Priority Queue plugin
I don't know SimpleAmqpClient but from your description it sounds like
you are consuming with no prefetch limit - i.e. RabbitMQ will send your
consumer as many messages as it likes, limited only by network speed.
Therefore messages aren't resting in the queue at all, they're sent
straight out to the client, and there is no opportunity for higher
priority messages to overtake lower ones.
You need to make sure messages are backing up in the queue (e.g. by
consuming with basic.qos set to some small value like 1) to see the
On 08/07/2014 10:09PM, Steven Blanc wrote:
> I have been experimenting with the priority queue plugin
> (3.3.x-72d20292) with RMQ Server 3.3.2.
> I have a simple producer and a simple consumer written in C++ using
> The consumer app creates a Channel (SimpleAmpqClient Channel), the
> exchange, the queue (as a priority queue with x-max-priority of 10) and
> a binding.
> I see this all properly from the RMW Admin GUI.
> After that it calls BasicConsume() and then goes into a loop calling
> BasicConsumeMessage() with a 1 second sleep between calls.
> Meanwhile, the simple producer creates a broker connection, then goes
> into a loop creating messages with a priority value assigned to be
> either 0 or 10.
> Where I think I see a bug is this:
> If the consumer calls BasicConsume BEFORE the messages are in the queue,
> they are consumed in FIFO order, without consideration of the priority
> If I sleep in the consumer before calling BasicConsume() until all
> messages are in the queue, they are consumed in priority order.
> Am I doing something wrong? Shouldn't the priority on each message
> place it in the queue according to priority over time and the already
> connected consumer(s) will get higher priority messages ahead of lower
> priority messages all the time?
> I looked at the Java example provided here:
> I am not a Java programmer, but it appears that example also publishes
> messages to a priority queue before there is a consumer and then creates
> a consumer of the queue which retrieves messages in priority order.
> Same results I see, but not the desired behavior I am looking for.
> Should this work after a consumer is attached to a queue and consuming
> it for all subsequent messages?
> rabbitmq-discuss mailing list has moved to https://groups.google.com/forum/#!forum/rabbitmq-users,
> please subscribe to the new list!
> rabbitmq-discuss at lists.rabbitmq.com
More information about the rabbitmq-discuss