示例#1
0
 public function testSetQosCountInChannel()
 {
     $this->channelMock->expects($this->once())->method('setPrefetchCount')->with($this->equalTo(3));
     $c = new Consumer($this->channelMock, $this->queueMock);
     $c->setQueueOptions(['name' => 'myQueue', 'binding' => ['name' => 'testName', 'routing-keys' => 'testKey'], 'qos_count' => 3]);
     $c->consume(function () {
     });
 }
示例#2
0
 protected function createConsumer($name)
 {
     $conf = $this->config['consumers'][$name];
     $conn = $this->connFactory->getConnection($conf['connection']);
     $consumer = new Consumer(new AMQPChannel($conn));
     $consumer->setQueueOptions($conf['queue_options']);
     $this->consumers[$name] = $consumer;
     return $consumer;
 }