[rabbitmq-discuss] problem on queue depth checking?
Jose Comboni
trancos at gmail.com
Tue Mar 13 16:13:55 GMT 2012
Make sure autoack is set to false.
From Jose's iPhone
On Mar 13, 2012, at 6:47 AM, sameekmishra <sameek at arosys.com> wrote:
>
> Defining the channel.basicQos(1) consumer will pick one message and do not
> pick any message from queue until it not got acknowledgement,if u think that
> consumer will consume all message from queue that's because I got queue
> depth zero but This may not be the case as.
>
> What i am thinking is that we need to define channel.basicQos(1) only in the
> consumer code not in queueDepth because it only give the total count of
> message.
>
> Even after defining the channel.basicQos(1) on consumer end, I am getting
> queuedepth value 0,which should be one. may other reason behind that i am
> getting wrong result.
>
> Thanks
> Sameek
>
>
> Simon MacMullen-2 wrote:
>>
>> On 13/03/12 13:01, sameekmishra wrote:
>>> Now if i publish 2 messages then one message will be consumed(and thread
>>> will sleep for one minute) and one will be in the queue;
>>> And queue depth checking thread must show the queuedepth = 1. But I am
>>> getting the queuedepth 0.
>>> But if we dont consume the message from queue then queuedepth is shown
>>> correctly.
>>
>> RabbitMQ will by default push as many messages to the consumer as it
>> can. On the consumer side they end up buffered in the QueueingConsumer.
>>
>> To change this behaviour, invoke channel.basicQos() and use acks. This
>> will bound the number of unacknowledged messages RabbitMQ will push to
>> your consumer.
>>
>> Cheers, Simon
>>
>> --
>> Simon MacMullen
>> RabbitMQ, VMware
>> _______________________________________________
>> rabbitmq-discuss mailing list
>> rabbitmq-discuss at lists.rabbitmq.com
>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>
>>
> --
> View this message in context: http://old.nabble.com/problem-on-queue-depth-checking--tp33494003p33494378.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list