apache artemis如何定时自动清理无效主题队列

发布时间:2022-01-13 09:21:57 作者:小新
来源:亿速云 阅读:378

这篇文章将为大家详细讲解有关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如何定时自动清理无效主题队列”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

推荐阅读:
  1. Apache的Kafka介绍
  2. 深入了解apache kafka数据采集

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

apache

上一篇:python冷知识print的使用方法有哪些

下一篇:Python面试题及答案有哪些

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》