Beispiel #1
0
 /**
  * @return AMQPChannel
  */
 public function getAmqpChannel()
 {
     if ($this->amqp_channel) {
         return $this->amqp_channel;
     }
     $this->amqp_channel = $this->connection->getAmqpConnection()->channel();
     $this->amqp_channel->queue_declare($this->queue_config['queue_name'], false, $is_durable = true, false, false);
     $this->amqp_channel->basic_qos(null, $this->queue_config['fetch_count'], null);
     return $this->amqp_channel;
 }
Beispiel #2
0
 /**
  * @covers ::disconnect
  */
 public function testConnectionIsClosedAfterExplicitlyDisconnecting()
 {
     $connection = new Connection($this->getRabbitCredentials());
     $amqp_connection = $connection->getAmqpConnection();
     $this->assertTrue($amqp_connection->isConnected());
     $connection->disconnect();
     $this->assertFalse($amqp_connection->isConnected());
 }