I've got a spring app that uses multiple queues to handle event processing. The app adds messages to these queues when specific events occur. When the messages are consumed they are removed implicitly. Example : RETRY_QUEUE to reprocess the message SUCCESS_QUEUE if the message gets through processing.
Internally I use @JmsListner to monitor the queue for incoming messages, how do I create a custom event handler that can be used to publish events when messages are added or removed from these queues ? I wanted to monitor these queues using prometheus gauges by inc() or dec() the queue size based on enqueue or dequeue events.