[rabbitmq-discuss] Question about new pika usage

Taek Joo Kim taicki at gmail.com
Sun Mar 6 02:31:30 GMT 2011


On Sat, Mar 5, 2011 at 9:14 PM, Gavin M. Roy <gmr at myyearbook.com> wrote:

>
>  On Saturday, March 5, 2011 at 9:07 PM, Taek Joo Kim wrote:
>
> Hi, all.
>
> In pika 0.5.2, I created multiple connections to rabbitmq, then made a
> socket map and passed it to pika.asyncore_loop(). Then I could poll
> multiple sockets. In pika 0.9.x, I saw the source code, but did not
> find the way to do this. The purpose of making multiple connections is
> to subscribe multiple queues.
>
> I have two questions.
> 1. Is this a proper way to subscribe multiple queues?
>
> Just issue multiple channel.basic_consume commands to different queues with
> different callback mechanisms with any of the async connection adapters.
>  You do not need multiple connections or channels to consume multiple
> queues.
>
> With BlockingConnection there will be support for multiple queue consumers
> in the next release.
>

Thank you for the answer. I just did a simple test and it seems to work.

The reason I made multiple connections is that getting items from several
queues did not work well when I created one connection and multiple channels
from that one connection. At that time I called channel.basic_consume in
each channel. So instead I created multiple connections and had one channel
from each.

Taek
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110305/cfc2b15f/attachment.htm>


More information about the rabbitmq-discuss mailing list