1 <broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000">
2 <destinationPolicy>
3 <policyMap>
4 <policyEntries>
5 <policyEntry queue=">" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/>
6 </policyEntries>
7 </policyMap>
8 </destinationPolicy>
9 </broker>
實現定時自動清理無效的Topic和Queue需要設置三個屬性。
schedulePeriodForDestinationPurge執行清理任務的周期,
gcInactiveDestinations="true"啟用清理功能
inactiveTimoutBeforeGC="30000" Topic或Queue超時時間
在規定的時間內,無有效訂閱,沒有入隊記錄,超時后就會被清理
轉自:http://my.oschina.net/csen66/blog/88193