Skip to main content

queue_bind

Binds a queue to an exchange using a specific routing key via the AMQP protocol. This function requires an active broker connection and will attempt to reconnect if the channel is unavailable or if an error occurs during the binding process.

def queue_bind(
amqp_context: object,
queue: string,
exchange: string,
routing_key: string
) - > null

Binds a queue to an exchange with a specific routing key to control how messages are routed.

Parameters

NameTypeDescription
amqp_contextobjectThe context object containing the active AMQP channel and connection state.
queuestringThe name of the queue to be bound.
exchangestringThe name of the exchange to bind the queue to.
routing_keystringThe routing pattern used to filter which messages are sent from the exchange to the queue.

Returns

TypeDescription
nullNothing is returned; the result of the operation is echoed to the console.