示例#1
0
 /**
  * {@inheritdoc}
  */
 public function publish(MessageInterface $message)
 {
     $body = json_encode(array('type' => $message->getType(), 'body' => $message->getBody(), 'createdAt' => $message->getCreatedAt()->format('U'), 'state' => $message->getState()));
     $amq = new AMQPMessage($body, array('content_type' => 'text/plain', 'delivery_mode' => 2));
     $this->getChannel()->basic_publish($amq, $this->exchange, $this->key);
 }
 /**
  * {@inheritdoc}
  */
 public function publish(MessageInterface $message)
 {
     $body = json_encode(array('type' => $message->getType(), 'body' => $message->getBody(), 'createdAt' => $message->getCreatedAt()->format('U'), 'state' => $message->getState()));
     $this->getTube($this->tube)->put($body);
 }