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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM