[rabbitmq-discuss] asynchronous fetching messages from rabbitMQ queues
pavankumar.manikonda at schneider-electric.com
Thu Nov 10 08:51:47 GMT 2011
Matthias Radestock-3 wrote:
>>> So you want a DequeueEverythingButWaitIfThereIsNothingThere() ?
> exactly. That is what I want.
>>> That should be straightforward to implement as a helper function. We
>>> could add it to the library, but I am curious about the use case here -
>>> I would have thought that most apps process messages individual rather
>>> than in blocks.
> My use case is that I am implementing a message processor which fetches
> messages from rabbitMQ, process them and save in database.
> When using 'BasicConsume' without setting BasicQos on channel, it seems it
> is connecting to RabbitMQ everytime I call 'consumer.Queue.Dequeue()'.
> This operation is getting costly because of network overhead. I resolved
> it as you suggested by setting the BasicQos with a very high value.
> Now instead of calling 'consumer.Queue.Dequeue()' everytime to fetch a
> message, If I was able to get these messages in an array or list, I can
> parallelize my operations on messages I have fetched.
> Hope the usecase is clear.
>>> Btw, you do realise that the Dequeue() operation is client-side only,
>>> right? i.e. it is simply manipulating a client side buffer which is
>>> filled as and when the client receives a message from the server.
> yes, I understood that. When I set the prefetch to 1000, at client side a
> buffer is being maintained which will contain a maximum of 1000 messages.
> When I call dequeue, it is giving me the message from this buffer.
> And if there are less than 1000 messages in buffer, it refills the buffer
> if there are any messages in the queue bound to it.
> correct me if my understanding is wrong.
> Also, I have a suggestion. Please add appropriate comments to the dotnet
> client library. It hard to understand what the methods are doing for new
> bibes like me.
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
View this message in context: http://old.nabble.com/asynchronous-fetching-messages-from-rabbitMQ-queues-tp32709671p32816959.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss