PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

AMQPExchange::delete

(PECL amqp >= Unknown)

AMQPExchange::deleteDelete the exchange from the broker.

Description

public bool AMQPExchange::delete ([ int $flags = AMQP_NOPARAM ] )

Delete and exchange from the broker.

Parameters

flags

Optionally AMQP_IFUNUSED can be specified to indicate the exchange should not be deleted until no clients are connected to it.

Errors/Exceptions

Throws AMQPExchangeException on failure.

Throws AMQPChannelException if the channel is not open.

Throws AMQPConnectionException if the connection to the broker was lost.

Return Values

Returns TRUE on success or FALSE on failure.

Examples

Example #1 AMQPExchange::delete example

<?php

/* Create a new connection */
$cnn = new AMQPConnection();
$cnn->connect();

/* Create a new exchange */
$ex = new AMQPExchange($cnn);
$ex->declare('new_topic_exchange'AMQP_EX_TYPE_DIRECTAMQP_DURABLE AMQP_AUTODELETE);

/* Delete the previous exchange */
$ex2 = new AMQPExchange($cnn);
$ex2->delete('new_topic_exchange');

?>

PHP Manual