Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 3rd, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $cnn = new AMQPConnection();
  2. $cnn->connect();
  3.  
  4. // Create a channel
  5. $ch = new AMQPChannel($cnn);
  6.  
  7. // Declare the orders-exchange
  8. $ex = new AMQPExchange($ch);
  9. $ex->setName("orders-exchange");
  10. $ex->setType(AMQP_EX_TYPE_DIRECT);
  11. $ex->setFlags(AMQP_DURABLE);
  12. $ex->declare();
  13.  
  14. // Publish a message to the exchange with the "order.submit" routing key
  15. $msg = $ex->publish($orderJson, "order.submit", AMQP_NOPARAM,
  16.                 array("Content-type" => "text/json"));