环境:MAC OS X 10.11.5 + ActiveMQ 5.13.3
1.为每个 Queue 指定一个死信队列
<policyEntry queue=">">
<deadLetterStrategy>
<!--
Use the prefix 'DLQ.' for the destination name, and make
the DLQ a queue rather than a topic
-->
<individualDeadLetterStrategy
queuePrefix="DLQ." useQueueForQueueMessages="true" />
</deadLetterStrategy>
</policyEntry>
2. 自动丢弃超时消息
<policyEntry queue=">">
<deadLetterStrategy>
<sharedDeadLetterStrategy processExpired="false" />
</deadLetterStrategy>
</policyEntry>
3. 如果希望非持久化消息超时后,也进入死信队列,需要增加如下设置
<policyEntry queue=">">
<deadLetterStrategy>
<sharedDeadLetterStrategy processNonPersistent="true" />
</deadLetterStrategy>
</policyEntry>
参考文献:
1. http://activemq.apache.org/message-redelivery-and-dlq-handling.html
1.为每个 Queue 指定一个死信队列
<policyEntry queue=">">
<deadLetterStrategy>
<!--
Use the prefix 'DLQ.' for the destination name, and make
the DLQ a queue rather than a topic
-->
<individualDeadLetterStrategy
queuePrefix="DLQ." useQueueForQueueMessages="true" />
</deadLetterStrategy>
</policyEntry>
2. 自动丢弃超时消息
<policyEntry queue=">">
<deadLetterStrategy>
<sharedDeadLetterStrategy processExpired="false" />
</deadLetterStrategy>
</policyEntry>
3. 如果希望非持久化消息超时后,也进入死信队列,需要增加如下设置
<policyEntry queue=">">
<deadLetterStrategy>
<sharedDeadLetterStrategy processNonPersistent="true" />
</deadLetterStrategy>
</policyEntry>
参考文献:
1. http://activemq.apache.org/message-redelivery-and-dlq-handling.html
没有评论:
发表评论