[rabbitmq-discuss] asynchronous fetching messages from rabbitMQ queues
pavuuu
pavankumar.manikonda at schneider-electric.com
Wed Nov 9 05:50:10 GMT 2011
Hello Matthew,
Calling BaiscQos on my channel helped me prefetch(say 100 messages) as
required.
But, when I call "consumer.Queue.Dequeue()" I get only 1 message. Do I have
to call Dequeue 100 times to fetch 100 messages? Cant I do it with one call
??
Matthew Sackman-3 wrote:
>
> On Mon, Oct 24, 2011 at 04:51:35AM -0700, pavuuu wrote:
>> Is it possible to fetch messages asynchronously from rabbitMQ queues ?
>
> Yes. Basic.consume will deliver msgs asynchronously to the client.
>
>> Colz when I do two consecutive BasicConsume's on any particular queue, I
>> get
>> the same message twice.
>
> Please provide code that demonstrates this - this should not happen.
> Multiple basic.consumes on the _same_ queue will make the queue deliver
> each message to one consumer (in the absence of requeuings).
>
>> If I have to fetch the first two messages, I have to do
>>
>> BasicConsume -- BasicAck -- BasicConsume -- BasicAck
>
> No.
>
> BasicConsume -> BasicDeliver -> BasicAck -> BasicDeliver -> BasicAck ...
>
>> Also, will the client library supports fetching, say top 100, messages of
>> any particular queue. ?
>
> Yes, you want want to use basic.qos and set the msg prefetch count to
> 100.
>
> Matthew
> _______________________________________________
> 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/asynchronous-fetching-messages-from-rabbitMQ-queues-tp32709671p32808823.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss
mailing list