/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }