How to configure shared DLQ for set of ActiveMQ queues?

Active MQ server offers custom DLQ configuration. 

If you have to host queues for many projects on the same ActiveMQ server you may want to customize Dead Letter Queue for each project. Configuration is pretty simple. A group of queues should share the same prefix e.g pre1

Let assume we have following queues:

  • pre1.queue1
  • pre1.queue2
  • pre1.queue3
  • pre1.queue.dlq – Dead Letter Queue

To set pre1.queue.dlq as custom DLQ for above group at ActiveMQ.xml file new policyEntry with sharedDeadLetterStrategy must me added. Here is example configuration:

<policyEntry queue="pre1.>">
  <deadLetterStrategy>
    <sharedDeadLetterStrategy>
      <deadLetterQueue>
        <queue physicalName="pre1.queue.dlq"/>
      </deadLetterQueue>
    </sharedDeadLetterStrategy>
  </deadLetterStrategy>
  <pendingMessageLimitStrategy>
    <constantPendingMessageLimitStrategy limit="1000"/>
  </pendingMessageLimitStrategy>
</policyEntry>
	

Leave a Reply

Your email address will not be published. Required fields are marked *