Hello. I'm looking for a simple way to clean DLQ queues on our ActiveMQ brokers. Messages are moved to DLQ queues when some unexpected conditions lead consumers to fail. We've no automatic processing for DLQ messages that are only needed for diagnosis. Nevertheless, when the queues contain too many messages, the ActiveMQ console or alternative browsing tools are not able to handle them, and, by the way, thousands of messages are useless. This is why we're looking for a periodic cleaning. For example, we could remove all messages that are older than N days.
A JMS selector can be used to check the JMSTimestamp is before a given time. But I can't find any way to write a route with a JMS 'from' statement that could evaluate something like : JMSTimestamp < NOW() - INTERVAL '7 days'... I imagine that more complex solutions could be considered, consuming all the DLQ queues messages, and moving them to other queues with an expiration time, setting a policy to delete expired messages. But this is not our first choice... I've also searched for a way to force ActiveMQ to set an expiration time on all DLQ messages, but It seems it's not possible. Any ideas are welcome ! Thanks in advance. Regards.