SharedDeadLetterStrategy 不会丢弃 DLQ 消息
我正在使用 AMQ 5.5。我想禁用向 ActiveMQ.DLQ 目的地发送死信的选项,并完全丢弃(自动)否则将发送到那里的消息。为此,我对代理进行了如下配置:
<amq:destinationPolicy>
<amq:policyMap>
<amq:policyEntries>
<amq:policyEntry topic=">" producerFlowControl="false" >
<amq:deadLetterStrategy>
<amq:sharedDeadLetterStrategy processExpired="false" />
</amq:deadLetterStrategy>
</amq:policyEntry>
<amq:policyEntry queue=">" producerFlowControl="false">
<amq:deadLetterStrategy>
<amq:sharedDeadLetterStrategy processExpired="false" />
</amq:deadLetterStrategy>
</amq:policyEntry>
</amq:policyEntries>
</amq:policyMap>
</amq:destinationPolicy>
但是,我仍然看到消息存储在 DLQ 中。您能让我知道是什么原因造成的吗? 我需要修复配置中的任何内容吗?
谢谢哈里
Am using AMQ 5.5. I would like to disable the option of sending dead letters to ActiveMQ.DLQ destination and completely discard (automatically) the messages that would be sent there otherwise. To do this I had configured the broker as below:
<amq:destinationPolicy>
<amq:policyMap>
<amq:policyEntries>
<amq:policyEntry topic=">" producerFlowControl="false" >
<amq:deadLetterStrategy>
<amq:sharedDeadLetterStrategy processExpired="false" />
</amq:deadLetterStrategy>
</amq:policyEntry>
<amq:policyEntry queue=">" producerFlowControl="false">
<amq:deadLetterStrategy>
<amq:sharedDeadLetterStrategy processExpired="false" />
</amq:deadLetterStrategy>
</amq:policyEntry>
</amq:policyEntries>
</amq:policyMap>
</amq:destinationPolicy>
However, I still see that the messages are getting stored in DLQ. Can you please let me know what could be causing this?
Do I need to fix anything in the config?
Thanks
Hari
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里面临的问题是,上面给出的配置只会丢弃非持久性过期消息。要丢弃所有过期消息(持久性消息和非持久性消息),请使用discardingDLQBrokerPlugin。
The problem faced here was that, the above given configuration would discard only non-persistent expired messages. To discard all expired messages, persistent and non-persistent, use discardingDLQBrokerPlugin.
<amq:plugins>
<amq:discardingDLQBrokerPlugin dropAll="true"/>
</amq:plugins>