is there any way to return the number of messages that are unacknowledged?
I am using this code to get the number of messages in the queue:
DeclareOk declareOk = amqpAdmin.getRabbitTemplate().execute(
new ChannelCallback<DeclareOk>() {
public DeclareOk doInRabbit(Channel channel)
throws Exception {
return channel.queueDeclarePassive(name);
}
});
return declareOk.getMessageCount();
but I would like to know as well the number of unacknowledged messages.
I have seen that the RabbitMQ Admin tool includes that information (for each queue it gives out the number of Ready/ Unacked and Total messages) and I guess there must be a way to retrieve that from Java/ Spring.
Thanks
UPDATE
Oks, it seems there is no way to accomplish that programmatically since listing of configuration/ queues is not part of AMPQ.
There is the possibility to enable the management plugin and query the REST web services about the queues (among other things). More info here:
http://www.rabbitmq.com/management.html