ActiveMQ Redelivery - 发送无效消息到 Q 的后面

ActiveMQ Redelivery - send invalid message to the back of the Q

重新投递后如何将消息发送到Q的后面? 目前是把消息发到Q前面,导致其他消息卡死

在重投耗尽的情况下,不要将消息放回原队列,而是利用DLQ(死信队列)机制

代理配置示例:

<destinationPolicy>
  <policyMap>
    <policyEntries>
      <!-- Set the following policy on all queues using the '>' wildcard -->
      <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>
    </policyEntries>
  </policyMap>
</destinationPolicy>

有关详细信息,请参阅 ActiveMQ documentation