溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

apache artemis如何定時自動清理無效主題隊列

發布時間:2022-01-13 09:21:57 來源:億速云 閱讀:482 作者:小新 欄目:大數據

這篇文章將為大家詳細講解有關apache artemis如何定時自動清理無效主題隊列,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

apache artemis 定時自動清理無效主題隊列

刪除不活動的隊列(Delete Inactive Destinations)

https://my.oschina.net/zengfr

artemis配置:

 <auto-delete-queues>true</auto-delete-queues>
      <auto-delete-created-queues>true</auto-delete-created-queues>
      <auto-delete-queues-delay>86400000</auto-delete-queues-delay>
      <auto-delete-queues-message-count>0</auto-delete-queues-message-count>
      <config-delete-queues>FORCE</config-delete-queues>

      <auto-delete-addresses>true</auto-delete-addresses>
      <auto-delete-addresses-delay>86400000</auto-delete-addresses-delay>
      <config-delete-addresses>FORCE</config-delete-addresses>
         </address-setting>

schedulePeriodForDestinationPurge:10000  每十秒檢查一次,默認為0,此功能關閉
gcInactiveDestinations: true  刪除掉不活動隊列,默認為false
inactiveTimoutBeforeGC:30000 不活動30秒后刪除,默認為60秒

修改activemq.xml 在<broker>里添加屬性schedulerSupport="true" 重啟mq

http://activemq.apache.org/delete-inactive-destinations

<broker xmlns="http://activemq.apache.org/schema/core" schedulePeriodForDestinationPurge="10000">
  <destinationPolicy>
     <policyMap>
        <policyEntries>
           <policyEntry queue=">" gcInactiveDestinations="true" inactiveTimoutBeforeGC="30000"/>
        </policyEntries>
     </policyMap>
  </destinationPolicy>
</broker>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" useJmx="true" 
		dataDirectory="${activemq.data}" schedulePeriodForDestinationPurge="60000">

        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" >
                  <pendingMessageLimitStrategy>
                    <constantPendingMessageLimitStrategy limit="1000"/>
                  </pendingMessageLimitStrategy>
                </policyEntry>
		<policyEntry queue=">" gcInactiveDestinations="true" inactiveTimeoutBeforeGC="30000"/>
              </policyEntries>
            </policyMap>
        </destinationPolicy>

關于“apache artemis如何定時自動清理無效主題隊列”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,使各位可以學到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女