downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

AMQPExchange::delete> <AMQPExchange::__construct
[edit] Last updated: Fri, 14 Jun 2013

view this page in

AMQPExchange::declare

(PECL amqp >= Unknown)

AMQPExchange::declareDeclare a new exchange on the broker.

Descrição

public int AMQPExchange::declare ( void )

Declare a new exchange on the broker.

Parâmetros

Valor Retornado

Retorna TRUE em caso de sucesso ou FALSE em caso de falha.

Erros

Throws AMQPExchangeException on failure.

Throws AMQPChannelException if the channel is not open.

Throws AMQPConnectionException if the connection to the broker was lost.

Exemplos

Exemplo #1 AMQPExchange::declare() example

<?php

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

$ch = new AMQPChannel($cnn);

$ex = new AMQPExchange($ch);
$ex->setName('new_topic_exchange');
$ex->setType(AMQP_EX_TYPE_DIRECT);
$ex->setFlags(AMQP_DURABLE AMQP_AUTODELETE);
$ex->declare();

?>



add a note add a note User Contributed Notes AMQPExchange::declare - [1 notes]
up
1
danil dot mipt at gmail dot com
14 days ago
deprecated.
Use AMQPExchange::declareExchange() and AMQPQueue::declareQueue() as the main methods.
https://github.com/pdezwart/php-amqp/pull/58

 
show source | credits | sitemap | contact | advertising | mirror sites