Skip to content

Commit

Permalink
Merge pull request #66 from J7mbo/declare-queue-count
Browse files Browse the repository at this point in the history
Calling AmqpContext::declareQueue() now returns an integer holding the queue message count
  • Loading branch information
makasim authored May 26, 2017
2 parents 4bbc5da + d30ce41 commit ba9859c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/amqp-ext/AmqpContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public function deleteQueue(PsrDestination $destination)

/**
* @param AmqpQueue|PsrDestination $destination
*
* @return int
*/
public function declareQueue(PsrDestination $destination)
{
Expand All @@ -127,11 +129,13 @@ public function declareQueue(PsrDestination $destination)
$extQueue->setName($destination->getQueueName());
}

$extQueue->declareQueue();
$count = $extQueue->declareQueue();

if (false == $destination->getQueueName()) {
$destination->setQueueName($extQueue->getName());
}

return $count;
}

/**
Expand Down

0 comments on commit ba9859c

Please sign in to comment.