The old journal files aren't cleanup when running ActiveMQ under the following conditions.
Conditions: * Using ActiveMQ 5.13.1 * Using MQTT (QoS=2) * MQTT Client is Eclipse Paho 1.0.0 * Subscriber's CleanSession is false. * Number of Subscribers is 1000 over. * Number of Topics is 1000 over. * A Topic and a Subscriber are in one-to-one manner. * Subscriber's offline timeout is about one month. (<broker offlineDurableSubscriberTimeout="2592000000" in activemq.xml) * Subscribers aren't always active, and repeat disconnection and connection. * Frequency of publish is 100 messages a day at most, it has been running over 3 months. I tried to analyze the journal files by amq-kahadb-tool(https://github.com/Hill30/amq-kahadb-tool), then found the strange subscribers. * KAHA_SUBSCRIPTION_COMMAND recorded in db-1.log (indicates the subscriber is durablesubscriber). * Several KAHA_ADD_MESSAGE_COMMANDs are recorded, but there may be no corresponding KAHA_REMOVE_MESSAGE_COMMAND (indicates the subscriber has pending message). * There is no KAHA_SUBSCRIPTION_COMMAND that should be recorded when an offline timeout occurs (indicates the durable subscriber is valid) So, it means that there are the offline durable subscribers having the pending messages from the commands recorded in the journal files. However, when starting ActiveMQ from the same KahaDB file (index and journal) as the loaded index(db.data) indicates that this subscriber does not exist in memory. Why does inconsistency occur between journal files and indexes ? Also, what could be the cause of the old journal file being not deleted ? -- Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html