I have a Java client which monitors RabbitMQ queue. I am able to get the count of messages currently in queue with this code
@Resource
RabbitAdmin rabbitAdmin;
..........
DeclareOk declareOk = rabbitAdmin.getRabbitTemplate().execute(new ChannelCallback<DeclareOk>() {
public DeclareOk doInRabbit(Channel channel) throws Exception {
return channel.queueDeclarePassive("test.pending");
}
});
return declareOk.getMessageCount();
I want to get some more additional details like -
- Message body of currently enqueued items.
- Total number of messages that was enqueued in the queue since the queue was created.
Is there any way to retrieve these data in Java client?
See Question&Answers more detail:os