Exemplo n.º 1
0
 /**
  * @param string $channel
  * @param string $classId
  * @param string $weight
  * @param string $bodySize
  * @param string $packedProperties
  * @param string $body
  *
  * @return Connection
  */
 public function sendContent($channel, $classId, $weight, $bodySize, $packedProperties, $body)
 {
     $outboundPacket = new Writer();
     $outboundPacket->writeOctet(2);
     $outboundPacket->writeShort($channel);
     $outboundPacket->writeLong(strlen($packedProperties) + 12);
     $outboundPacket->writeShort($classId);
     $outboundPacket->writeShort($weight);
     $outboundPacket->writeLongLong($bodySize);
     $outboundPacket->write($packedProperties);
     $outboundPacket->writeOctet(0xce);
     $outboundPacket = $outboundPacket->getvalue();
     $this->write($outboundPacket);
     while ($body) {
         $payload = substr($body, 0, $this->frameMax - 8);
         $body = substr($body, $this->frameMax - 8);
         $outboundPacket = new Writer();
         $outboundPacket->writeOctet(3);
         $outboundPacket->writeShort($channel);
         $outboundPacket->writeLong(strlen($payload));
         $outboundPacket->write($payload);
         $outboundPacket->writeOctet(0xce);
         $outboundPacket = $outboundPacket->getvalue();
         $this->write($outboundPacket);
     }
     return $this;
 }
Exemplo n.º 2
0
 /**
  * @param string $deliveryTag
  * @param bool   $reQueue
  *
  * @return \AMQP\Wire\Writer
  */
 public function basicReject($deliveryTag, $reQueue)
 {
     $args = new Writer();
     $args->writeLongLong($deliveryTag)->writeBit($reQueue);
     return $args;
 }