We have an ActiveMQ instance, where a client is consuming from a jms-queue, reading some values from the msg and using them as parameters to an API-call.
The order of the msgs are important, so in case of a failure (typically, the API called is temporarily down for a while), I want all msgs to REMAIN in the queue and the client should just try resend them until the processing succeeds, so I have set maximumRedeliveries="-1" redeliveryDelay="5000" for unlimited redeliveries. What I notice while testing, though, is that even though the API is down (i.e. message processing is failing, and messages are getting queued up), the ActiveMQ console is still showing 0 messages in the queue. The "Messages Enqueued/Dequeued" are increasing, and I can also confirm from the logs that messages are actually failing and being re-sent as expected. Also, if I shutdown everything, and restart ActiveMQ without restarting the consumer, the messages re-appear in the console. But for monitoring purposes, I would just like to DETECT this situation that the message backlog is growing and not getting consumed. How can I see the actual backlog/length of the failed-message queue (even though the console shows 0) in such a situation?
