I have a rabbit consumer that works fine (it correctly processes messages, sends acks, etc.).
In it, I am trying to check if a queue is empty using the queue_declare and passive flag (as suggested here: RabbitMQ - How to check if queue is empty?).
The relevant part of the code looks like this:
<?php
$a = $this->channel->queue_declare($queueName, true);
var_dump($a);
My problem is that it always returns (regardless on how many messages are on queue - I tested with like 1000):
array(3) {
[0]=>
string(4) "fastQueue"
[1]=>
int(0)
[2]=>
int(1)
}
Any idea why?