when to use bind_to for Exchange and Queue

Skip to first unread message

Robert Myers

Sep 4, 2013, 2:29:04 PM9/4/13
to carrot...@googlegroups.com
I'm wondering what the difference between Exchange.bind_to and Queue.bind_to are.

My understanding is that Exchange.bind_to is when I want to change the exchange from one to another/create another etc.,...

In this example:

callback_queue = Queue(name=callback_queue_name, exclusive=True, noAck=True)(connection)
queue.bind_to(exchange=exchange, routing_key=callback_queue_name)

it seems to me that I can't get the exchange to route the message properly unless I do a queue.bind_to.  My understanding of this would be something like, when I create the queue object and specify the routing_key, it's all over but sending/consuming.

is that right, or am I misreading something?

Thanks in advance for any insight.

Robert Myers

Sep 4, 2013, 4:16:23 PM9/4/13
to carrot...@googlegroups.com
Answered my own question on this one.  During the declaration of Queue, I neglected to put an exchange.

Now it works the way I thought it should, apparently I mixed up my examples. :)
Reply all
Reply to author
0 new messages