Ejemplo n.º 1
0
 /**
  * @param Message $msg
  * @param array   $options
  *
  * basicPublish($msg,
  *  array(
  *      'exchange' => '',
  *      'routing_key' => '',
  *      'mandatory' => false,
  *      'immediate' => false,
  *      'ticket' => null)
  * )
  */
 public function basicPublish(\AMQP\Message $msg, $options = array())
 {
     $default = array('exchange' => '', 'routing_key' => '', 'mandatory' => false, 'immediate' => false, 'ticket' => null);
     $options = array_merge($default, $options);
     $options['ticket'] = $this->getTicket($options['ticket']);
     $args = $this->frameBuilder->basicPublish($options);
     $this->sendMethodFrame(array(60, 40), $args);
     $this->connection->sendContent($this->channelId, 60, 0, strlen($msg->body), $msg->serializeProperties(), $msg->body);
 }