Spring JMS Activemq - set dead letter queue-name (DLQ)

你说的曾经没有我的故事 提交于 2019-12-05 08:25:59

I think you need to configure the deadLetterStrategy at the broker. Please refer the examples at - ActiveMQ DLQ

You can choose the individualDeadLetterStrategy which creates a separate DLQ for each queue (depends upon your destination policy). You can have a different prefix for each of your project/application. So that you can have only one consumer per project/application which consumes the DLQ messages from all DLQs starting with the respective prefix (use wildcards while creating consumer).

You can go to your Apache ActiveMQ folder. there you will get activemq.xml in /config folder.
add this code in under the <broker> tag in you activemq.xml file

 <destinationPolicy>
            <policyMap>
              <policyEntries>                          
                <policyEntry queue=">">
                  <deadLetterStrategy>
                    <individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true"/>
                  </deadLetterStrategy>
                </policyEntry>
              </policyEntries>
          </policyMap>
 </destinationPolicy>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!