activemq 队列消息定时清理



<broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000">
    <destinationPolicy>
       <policyMap>
          <policyEntries>
             <policyEntry queue=">" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/>
          </policyEntries>
       </policyMap>
    </destinationPolicy>     
  </broker>


实现定时自动清理无效的Topic和Queue需要设置三个属性。
schedulePeriodForDestinationPurge执行清理任务的周期,
gcInactiveDestinations="true"启用清理功能
 inactiveTimoutBeforeGC="30000" Topic或Queue超时时间
在规定的时间内,无有效订阅,没有入队记录,超时后就会被清理

转载地址:http://my.oschina.net/csen66/blog/88193

猜你喜欢

转载自blog.csdn.net/lkx444368875/article/details/50434059