[rabbitmq-discuss] BasicQoS usage: consuming 1 by 1 messages avoind unacking the whole queue

Simon MacMullen simon at rabbitmq.com
Wed Apr 6 17:48:00 BST 2011

On 06/04/11 17:20, Alfonso Pantoja wrote:
> I'm testing if it is possible to recover 1 by 1 message in order to
> keep in limbo state (unacked) only that message.
> It is posible?


> I'm using .NET API 2.4.0 (method call BasicQoS(0,1,false) ) against
> RabbitMQ 2.2.0
> but does not work (API get all messages from the queue so all of them
> stay unacked If no ack is sent).

That certainly should work. Are you sending basic.qos *before* 
consuming? If you consume first you may get a load of messages sent 
immediately, before the qos takes effect.

> Also BasicQoS does not work if first parameter is !=0 (I get a
> and the same with third parameter set to true.

Yes. The first of those would be to ration bytes rather than messages, 
the second would mean to apply the count over the whole connection 
rather than the channel. We don't implement either.

> By the way, parameters are:
> BasicQoS(uint prefetchSize, uint prefecthCount, bool global) They are
> not documented but I suppose the
> the call BasicQoS(0,1,false)should be what I want...

See documentation at:


> The other option would be to use BasicGet but I don't know if this
> method keeps unack only 1 message (didn't tested yet) but I'm thinking
> that the performance will be very low. Am I right?

If you keep invoking get without acking then you could have more than 
one unacked, but that's up to you. The performance is not great, that's 
right. And you'd have to poll. Ugh.

Cheers, Simon

Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware

More information about the rabbitmq-discuss mailing list