[rabbitmq-discuss] basic.getall?

Robert Raschke rtrlists at googlemail.com
Thu Nov 26 09:57:47 GMT 2009


On Wed, Nov 25, 2009 at 9:04 PM, JD Conley <jdc at hive7.com> wrote:

> What would be the best approach to get all of the messages in a queue with
> as few calls as possible? Right now I'm doing a basic.get loop until the
> queue is empty, but I think there is probably a better way.
>
>
Well, in my experience the fastest way to get messages is through
subscribe/deliver. That can have your desired side-effect of keeping the
queue clear if you can process the messages quickly enough.

It doesn't address your immediate question, though. Sorry.

On further thought, I guess you can mimic a getall approach by having a
consumer do the buffering for you. So, provide a client that subscribes to
the queue and buffers all the delivered messages. Your current end client
then uses whatever interface your intermediate one supplies to get all
currently buffered messages.

Robby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20091126/f1659724/attachment.htm 


More information about the rabbitmq-discuss mailing list