
Untitled
By: a guest on
Aug 3rd, 2012 | syntax:
None | size: 0.45 KB | hits: 8 | expires: Never
$cnn = new AMQPConnection();
$cnn->connect();
// Create a channel
$ch = new AMQPChannel($cnn);
// Declare the orders-exchange
$ex = new AMQPExchange($ch);
$ex->setName("orders-exchange");
$ex->setType(AMQP_EX_TYPE_DIRECT);
$ex->setFlags(AMQP_DURABLE);
$ex->declare();
// Publish a message to the exchange with the "order.submit" routing key
$msg = $ex->publish($orderJson, "order.submit", AMQP_NOPARAM,
array("Content-type" => "text/json"));