AMQPExchange
PHP Manual

AMQPExchange::publish

(PECL amqp >= Unknown)

AMQPExchange::publishPublish a message to an exchange.

Descrizione

public bool AMQPExchange::publish ( string $message , string $routing_key [, int $flags = AMQP_NOPARAM [, array $attributes = array() ]] )

Publish a message to the exchange represented by the AMQPExchange object.

Elenco dei parametri

message

The message to publish.

routing_key

The routing key to which to publish.

flags

One or more of AMQP_MANDATORY and AMQP_IMMEDIATE.

attributes

Supported indexes
key Description Default value
content_type   text/plain
content_encoding   NULL
message_id   NULL
user_id   NULL
app_id   NULL
delivery_mode   NULL
priority   NULL
timestamp   NULL
expiration   NULL
type   NULL
reply_to   NULL

Valori restituiti

Restituisce TRUE in caso di successo, FALSE in caso di fallimento.

Errori/Eccezioni

Throws an AMQPExchangeException on failure.

Throws AMQPChannelException if the channel is not open.

Throws AMQPConnectionException if the connection to the broker was lost.


AMQPExchange
PHP Manual