Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function getNackFrame(Frame $frame, $transactionId = null)
 {
     $nack = $this->createFrame('NACK');
     $nack['transaction'] = $transactionId;
     if ($this->hasVersion(Version::VERSION_1_2)) {
         $nack['id'] = $frame['ack'] ?: $frame->getMessageId();
     } else {
         $nack['message-id'] = $frame['ack'] ?: $frame->getMessageId();
         if ($this->hasVersion(Version::VERSION_1_1)) {
             $nack['subscription'] = $frame['subscription'];
         }
     }
     return $nack;
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 public function getAckFrame(Frame $frame, $transactionId = null)
 {
     $ack = $this->createFrame('ACK');
     $ack['transaction'] = $transactionId;
     if ($this->hasVersion(Version::VERSION_1_2)) {
         $ack['id'] = $frame->getMessageId();
     } else {
         $ack['message-id'] = $frame->getMessageId();
     }
     // spec quote: "ACK should always specify a "subscription" header for the subscription id that the message to be acked was delivered to ."
     // see https://mq.java.net/4.4-content/stomp-funcspec.html
     $ack['subscription'] = $frame['subscription'];
     return $ack;
 }