Пример #1
0
 /**
  * ActiveMq subscribe frame.
  *
  * @param string $destination
  * @param array $headers
  * @param boolean $durable durable subscription
  * @return Frame
  */
 public function getSubscribeFrame($destination, array $headers = array(), $durable = false)
 {
     $frame = parent::getSubscribeFrame($destination, $headers, $durable);
     if ($this->hasClientId() && $durable) {
         $frame->setHeader('persistent', 'true');
     }
     return $frame;
 }
Пример #2
0
 /**
  * ActiveMq subscribe frame.
  *
  * @param string $destination
  * @param array $headers
  * @param boolean $durable durable subscription
  * @return Frame
  */
 public function getSubscribeFrame($destination, array $headers = array(), $durable = false)
 {
     $frame = parent::getSubscribeFrame($destination, $headers);
     $frame->setHeader('activemq.prefetchSize', $this->getPrefetchSize());
     if ($durable) {
         $frame->setHeader('activemq.subscriptionName', $this->getClientId());
     }
     return $frame;
 }
Пример #3
0
 /**
  * RabbitMq subscribe frame.
  *
  * @param string $destination
  * @param array $headers
  * @param boolean $durable durable subscription
  * @return Frame
  */
 public function getSubscribeFrame($destination, array $headers = array(), $durable = false)
 {
     $frame = parent::getSubscribeFrame($destination, $headers);
     $frame->setHeader('prefetch-count', $this->getPrefetchSize());
     $this->addClientId($frame);
     if ($durable) {
         $frame->setHeader('persistent', 'true');
     }
     return $frame;
 }
Пример #4
0
 /**
  * Register to listen to a given destination
  *
  * @param string $destination Destination queue
  * @param array $properties
  * @param boolean $sync Perform request synchronously
  * @param boolean $durable durable subscription
  * @return boolean
  * @throws StompException
  */
 public function subscribe($destination, $properties = null, $sync = null, $durable = false)
 {
     $subscribe = $this->sendFrame($this->protocol->getSubscribeFrame($destination, $properties ?: array(), $durable), $sync);
     return $this->subscriptions[$destination] = $subscribe;
 }