Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 /**
  * 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;
 }
Ejemplo n.º 3
0
 /**
  * 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;
 }