In A-MQ 6.3, expired messages not removed from Database.

Solution Verified - Updated -

Issue

  • I set message's TTL by <to uri="jms:queue:xyz?timeToLive=1000" /> or producer.setTimeToLive(5000) from producer, normally, the expired messages will be removed or move to DLQ by the queue from A-MQ 6.3.

  • But if I used Database instead of Kahadb as persistence store, the behaviour sometime didn't work well, the message will stay in the queue forever, the debug log shows:

2018-04-10 12:49:50,347 | DEBUG | r[amq] Scheduler | Queue                            | che.activemq.broker.region.Queue  923 | 162 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630310 | queue:/Q1 expiring messages ..
2018-04-10 12:49:50,347 | DEBUG | r[amq] Scheduler | Queue                            | che.activemq.broker.region.Queue  929 | 162 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630310 | queue:/Q1 expiring messages done.
2018-04-10 12:49:50,347 | DEBUG | [amq] Task-55875 | Queue                            | che.activemq.broker.region.Queue 1926 | 162 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630310 | queue:/Q1, subscriptions=0, memory=70%, size=1456, pending=0 toPageIn: 200, force:false, Inflight: 0, pagedInMessages.size 0, pagedInPendingDispatch.size 0, enqueueCount: 1978, dequeueCount: 522, memUsage:7407760, maxPageSize:200
...
2018-04-13 11:12:52,647 | DEBUG | r[amq] Scheduler | Queue                            | che.activemq.broker.region.Queue  923 | 162 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630310 | queue:/Q1 expiring messages ..
2018-04-13 11:12:52,647 | DEBUG | r[amq] Scheduler | Queue                            | che.activemq.broker.region.Queue  929 | 162 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630310 | queue:/Q1 expiring messages done.
2018-04-13 11:12:52,647 | DEBUG | [amq] Task-58049 | Queue                            | che.activemq.broker.region.Queue 1926 | 162 - org.apache.activemq.activemq-osgi - 5.11.0.redhat-630310 | queue:/Q1, subscriptions=0, memory=70%, size=1670, pending=0 toPageIn: 200, force:false, Inflight: 0, pagedInMessages.size 0, pagedInPendingDispatch.size 0, enqueueCount: 2192, dequeueCount: 522, memUsage:7407760, maxPageSize:200
  • The expired messages stayed in Queue and Database forever.

Environment

  • Red Hat JBoss A-MQ
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.