Ejemplo n.º 1
0
 public function publishReply(Message $msg, MappableApi $api)
 {
     if (!$msg->getReplyTo()) {
         return null;
     }
     $queueName = $msg->getReplyTo();
     $worker = new WorkerPublisher($this->connection, $queueName);
     return $worker->publish($api, ['expiration' => ['T', strtotime('+5 minutes')]], $msg->getId());
 }
 public function create(Context $context, $paramName)
 {
     $headers = $context->getRequest()->getHeaders();
     $msg = new Message();
     $created = isset($headers['created']) ? $headers['created'] : null;
     $expiration = isset($headers['expiration']) ? $headers['expiration'] : null;
     $msg->setHeaders($headers);
     $msg->setExpiration($expiration);
     $msg->setCreated($created);
     return $msg;
 }