[rabbitmq-discuss] pika.channel.basic_consume

Marek Majkowski majek04 at gmail.com
Fri Jan 28 14:15:13 GMT 2011

On Fri, Jan 28, 2011 at 14:03, Marcin Krol <mrkafk at gmail.com> wrote:
> Gavin M. Roy wrote:
>> On Thu, Jan 27, 2011 at 2:52 PM, Marcin Krol <mrkafk at gmail.com> wrote:
>>> Can channel.basic_consume handle more than 1 callback?
>> It can't right now, but I am working on the next version and would
>> consider adding it for good reason. Is there a reason you want to do
>> this?
> Well, basically I need to do 2 kinds of RPC using the same client and
> server: read-write kind of RPC is distributed among all the servers in a
> cluster ("data safety through redundancy" reason), while another
> (read-only) kind of RPC executes only in the server that the client
> connected to.
> I could see from a not delivering the same message twice but you
>> could just use a fanout exchange and bind both consumers to this.
> I need to run one or the other, not both, as consumers are somewhat
> different. That's why I used 2 different exchanges for 2 callback queues.

Right. Now I can see it, you indeed use two different queues,
reusing the same variable name confused me.

In such case when you enter asyncore.loop()
one callback should be called when message
arrives to one queue and the other callback should
be called on message arrives in the other queue.


More information about the rabbitmq-discuss mailing list