4.2.2. Declaring and Binding a Queue

declare_queues.py creates a queue on the broker. The main body of this program consists of only two lines of code. The first line creates the queue and names it message_queue. The second line determines which messages are routed to the queue, by instructing the broker to route all messages sent to the amq.direct exchange with the routing key routing_key to the queue named message_queue.
session.exchange_bind(exchange="amq.direct", queue="message_queue", binding_key="routing_key")