Last 5.3 release ever available: PHP 5.3.29 - 5.3 now EOL

AMQPQueue::bind

(PECL amqp >= Unknown)

AMQPQueue::bindBind the given queue to a routing key on an exchange.

Description

public bool AMQPQueue::bind ( string $exchange_name , string $routing_key )

The bind method will bind the given queue to the specified routing key on the given exchange.

Warning

This function is currently not documented; only its argument list is available.

Parameters

exchange_name

The exchange name on which to bind.

routing_key

The routing key to which to bind.

Return Values

Returns TRUE on success or FALSE on failure.

add a note add a note

User Contributed Notes 2 notes

up
0
christian dot audebert at wanadoo dot fr
7 months ago
don't forget to enclose  $queue->bind(string $exchange_name , string $routing_key )
in a try/catch block.
like this

try{
        $queue->bind('edi:file:atraiter', 'new');
} catch (Exception $e) {
       echo 'Exception re├žue : ',  $e->getMessage(), "\n";
    unset($queue);   
}

// personnaly, i unset the $queue in catch and test it after to continue or not..
if (isset($queue)) ....
up
0
gdr at go2 dot pl
3 years ago
If the bind() operation is blocking for you, make sure you're performing it on a fresh connection - use reconnect() or so. This took me hours to figure out.
To Top