public function getUnsubscribeFrame($destination, array $headers = array(), $durable = false) { $frame = parent::getUnsubscribeFrame($destination, $headers, $durable); if ($this->hasClientId() && $durable) { $frame->setHeader('activemq.subscriptionName', $this->getClientId()); } return $frame; }
/** * RabbitMq unsubscribe frame. * * @param string $destination * @param array $headers * @param boolean $durable durable subscription * @return Frame */ public function getUnsubscribeFrame($destination, array $headers = array(), $durable = false) { $frame = parent::getUnsubscribeFrame($destination, $headers); $this->addClientId($frame); if ($durable) { $frame->setHeader('persistent', 'true'); } return $frame; }
/** * Graceful disconnect from the server * */ public function disconnect() { try { if ($this->connection && $this->connection->isConnected()) { if ($this->protocol) { $this->sendFrame($this->protocol->getDisconnectFrame(), false); } $this->connection->disconnect(); } } catch (StompException $ex) { // nothing! } $this->sessionId = null; $this->subscriptions = array(); $this->unprocessedFrames = array(); $this->protocol = null; }