ActiveMQ定时删除过期Topic和Queue

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
posted @ 2013-01-25 10:08  悟寰轩-叶秋  阅读(6349)  评论(0编辑  收藏  举报