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

Simon MacMullen simon at rabbitmq.com
Fri Apr 8 16:09:55 BST 2011


On 07/04/11 15:25, Alfonso Pantoja wrote:
> Is there any difference between BasicConsume using a QoS as
> prefecthCount=1
> and using BasicGet?
> I suppose prefecthCount=1 means than more TCP paquets are sent from
> Rabbit to consumers but besides this
>   is BasicConsume more efficient than BasicGet under this conditions or
> the underlying logic is almost the same?

The difference is that basic.get will return immediately if there are no 
messages for you, whereas [basic.qos(prefetchCount=1), basic.consume] 
will wait for a message to become available. So if you use basic.get 
you'll have to keep polling. In general you probably want to use 
basic.consume.

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



More information about the rabbitmq-discuss mailing list