is there any way to return the number of unacknowledged messages?
I use 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 also like to know the number of unrecognized messages.
I saw that the RabbitMQ Admin tool includes this information (for each queue it displays the number of Ready / Unacked and Total messages), and I guess there should be a way to get this from Java / Spring.
thanks
UPDATE
Oks, it seems that there is no way to execute this programmatically, as the configuration / queue list is not part of AMPQ.
It is possible to enable the management plugin and request REST web services for queues (among other things). More details here:
http://www.rabbitmq.com/management.html
Javier moreno garcia
source share