ActiveMQ死信队列使用

由于测试环境应用复杂的原因,造成了jms死信队列一直挤压很多数据,从而导致存储爆满,进而造成了各个客户端不能正常发送消息。
针对这些死信队列,一般都没有利用价值的。测试一般都关注某模块!
为了避免某队列的死信队列的挤压,而使整个jms不可用,我们选择了通过ActiveMQ的配置,直接丢弃掉死信队列的消息。


自动丢弃过期消息(Expired Messages)

简单丢弃过期消息,而不将它们放到DLQ中,完全跳过DLQ。
在dead letter strategy死信策略上配置processExpired属性为false,可以实现这个功能。

    <broker...>  
      <destinationPolicy>  
       <policyMap>  
         <policyEntries>  
           <!-- Set the following policy on all queues using the '>' wildcard -->  
           <policyEntry queue=">">  
             <!--  
               Tell the dead letter strategy not to process expired messages  
               so that they will just be discarded instead of being sent to  
               the DLQ  
             -->  
             <deadLetterStrategy>  
                <sharedDeadLetterStrategy processExpired="false" />  
             </deadLetterStrategy>  
           </policyEntry>  
         </policyEntries>  
       </policyMap>  
      </destinationPolicy>  
    ...  
    </broker>  
原文地址  :http://blog.csdn.net/zlfprogram/article/details/43269033
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值