|
Sometimes you might want to delete destinations that are inactive for a period of time. Since ActiveMQ version 5.4.0, it's possible to do that using destination policy entries and broker attribute schedulePeriodForDestinationPurge > 0. For example a configuration like <broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000"> <destinationPolicy> <policyMap> <policyEntries> <policyEntry queue=">" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/> </policyEntries> </policyMap> </destinationPolicy> </broker> will check for inactive destination every 10 seconds (schedulePeriodForDestinationPurge option, default value is 0). And it will delete all queues (gcInactiveDestinations option, false by default) if they are empty for 30 seconds (inactiveTimoutBeforeGC option, default is 1 minute). When the destination is removed, you can see messages like INFO Queue - TEST.QUEUE Inactive for longer than 30000 ms - removing ...
in the log file. |