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="" schedulePeriodForDestinationPurge="10000">

             <policyEntry queue=">" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/>

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.

© 2004-2011 The Apache Software Foundation.
Apache ActiveMQ, ActiveMQ, Apache, the Apache feather logo, and the Apache ActiveMQ project logo are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
Graphic Design By Hiram