I'm running ActiveMQ 5.1.0 with the AMQ persistence adapter, and it appears that not all of the journal files get cleaned up. My setup is a little abnormal, as I'm trying to test out ActiveMQ's ability to handle queue messaging with consumers that may become inactive for periods of time.
So for this test, I have a single publisher pushing messages out to 21 queues. These are persistent messages with an expiration time. I have a message listener reading from all queues (reading from '>'). So, as soon as the message is sent to the queues, it's read by the message listener, taking it off the queue. So far, so good.
I have a 2 MB max file length set on the AMQ persistence adapter. So, I would expect to see for the journal, 2 MB files that get cleaned up after the file rolls over. However, the journal files don't always get cleaned up, as shown in the file listing below. Out of 181 rollovers, 30 of the files did not get cleaned up. The message listener showed no errors, and as far as I can tell, it didn't drop any messages.
I've also tried taking out the wildcard '>' on a single consumer, and instead used separate consumers for each queue, and I get the same result.
I haven't even gotten to the test yet where the listener is not running. So, in this "normal" operation, all messages are consumed. Yet, not all journal files get cleaned up. These left-over files don't ever get cleaned up. They will eventually start filling the hard drive. I can understand files being left behind when there's no consumer, but there is a consumer the whole time.
What I'm basically looking for is a persistence layer for messaging to multiple clients, so that consumers can get messages retroactively when they start up. I could try to use topics with durable clients, but I thought the queues would be easier to setup, as messages in queues are persisted by default. However, I don't want the consumer to process "stale" messages, which is why I set an expiration time. So, I would think that, with a constant rate of messages, the persistent disk store utilization would eventually level out as the messages started to expire. I realize that if there's no consumer for a queue, expired messages won't get cleaned up (am currently trying to figure out a work-around for that - periodically checking the queues with a QueueBrowser seems to trigger the removal of expired messages). However, even when all consumers are active, the journal keeps growing, as it's not always cleaning up it's files!
I've attached my configuration to this ticket.