这篇文章将为大家详细讲解有关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如何定时自动清理无效主题队列”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。
原文链接:https://my.oschina.net/zengfr/blog/4831566