Skip to content

Commit a71652c

Browse files
committed
Merge pull request #272 from remco1976/master
Fixed consumers leak
2 parents 5269d59 + 0b73af0 commit a71652c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

RabbitMq/RpcClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public function addRequest($msgBody, $server, $requestId = null, $routingKey = '
4444
public function getReplies()
4545
{
4646
$this->replies = array();
47-
$this->getChannel()->basic_consume($this->getQueueName(), '', false, true, false, false, array($this, 'processMessage'));
47+
$consumer_tag = $this->getChannel()->basic_consume($this->getQueueName(), '', false, true, false, false, array($this, 'processMessage'));
4848

4949
while (count($this->replies) < $this->requests) {
5050
$this->getChannel()->wait(null, false, $this->timeout);
5151
}
5252

53-
$this->getChannel()->basic_cancel($this->getQueueName());
53+
$this->getChannel()->basic_cancel($consumer_tag);
5454
$this->requests = 0;
5555
$this->timeout = 0;
5656

@@ -70,7 +70,7 @@ public function processMessage(AMQPMessage $msg)
7070
protected function getQueueName()
7171
{
7272
if (null === $this->queueName) {
73-
list($this->queueName, ,) = $this->getChannel()->queue_declare("", false, false, true, true);
73+
list($this->queueName, ,) = $this->getChannel()->queue_declare("", false, false, true, false);
7474
}
7575

7676
return $this->queueName;

0 commit comments

Comments
 (0)