I think that for one consumer to subscribe to many queues using bunny
you would have to employ some kind of multi-threaded processing model.
Each thread could use its own channel and reuse a single connection,
but I don't know what this would actually look like in code (assuming
that it could be written). Like I've said before, I have played a
little with bunny and threads, but I much prefer the idea of a number
of simple consumers rather than one complex one.
Regards,
Chris
_______________________________________________
bunny-amqp-devel mailing list
bunny-am...@rubyforge.org
http://rubyforge.org/mailman/listinfo/bunny-amqp-devel
On 3 Feb 2010, at 20:01, vishnu wrote:
> Hi Chris
> oh I didnt mean in a multi-threaded model. It looks like the
> java client allows you to subscribe to multiple queues in a single
> thread. It seems to work because a subscription is on a channel,
> not a queue. So it always gets one message from any of the queues
> it subscribes on and does not see the next message unless it deals
> with that one. (with prefetch 1)
Bunny is a simple beast. When you subscribe it starts an infinite
loop with a blocking read in it, so I can't think of a way to do what
you want unless you use a thread per channel. I've not looked at the
Java client in detail, but I suspect that multiple threads would be
needed to do what you describe it doing.