ActiveMQ - Kaha persistence filling up disk

605 Views Asked by At

I am using ActiveMQ and kahadb 5.7.0. My broker is configured like this :

<amq:broker id="broker" useJmx="true" persistent="true" useShutdownHook="false"  >
        <amq:transportConnectors>
            <amq:transportConnector uri="tcp://localhost:61616?jms.messagePrioritySupported=true" />
        </amq:transportConnectors>
  <amq:persistenceAdapter>
     <amq:kahaPersistenceAdapter directory="activemq-data" maxDataFileLength="10g"/>
   </amq:persistenceAdapter>

    <amq:destinationPolicy>
            <amq:policyMap>
                <amq:policyEntries>
                    <amq:policyEntry queue=">" producerFlowControl="false" prioritizedMessages="true" >  <amq:pendingQueuePolicy>
                        <amq:fileQueueCursor />
                    </amq:pendingQueuePolicy>
                    </amq:policyEntry>
        </amq:policyEntries>
            </amq:policyMap>
        </amq:destinationPolicy>
 <amq:systemUsage>
            <amq:systemUsage>
                <amq:memoryUsage>
                    <amq:memoryUsage limit="2 gb"/>
                </amq:memoryUsage>
                <amq:storeUsage>
                    <amq:storeUsage limit="20 gb"/>
                </amq:storeUsage>
                <amq:tempUsage>
                    <amq:tempUsage limit="5 gb"/>
                </amq:tempUsage>
            </amq:systemUsage>
        </amq:systemUsage>
    </amq:broker>

The problem i have is that i see files in the directory activemq-data growing in size, especially files with data-queue-data. Most of them reach the 10g limit

Why is not cleaning those files ?

1

There are 1 best solutions below

1
On BEST ANSWER

First thing would be to update to a recent release, 5.7.0 is years old now and many, many....many bugs have been fixed since then.

You need to investigate what is causing data to be retained in the store which all comes down to how you are using the broker and how your consumers are reading and acknowledging (or not which is likely the case) message that are placed onto the brokers queues. One common issue is consumers using message selectors leaving old unconsumed messages lingering on the broker which will result in data being retained.

There is a very good bit of documentation on the ActiveMQ website that explains steps in debugging log file retention.