ActiveMQ Configuration of default RedeliveryPolicy.maximumRedeliveries for all connections
<p>I am looking for the right way to send all messages to the dead letter queue after a defined amount of retries. </p>

<p>Since the redeliveryPlugin works only with local storage and thus breaks our JDBC based HA configuration, we decided to run all messages into DLQs. </p>

<p>The <code>individualDeadLetterStrategy</code> destination configuration comes in handy here:</p>

<pre><code>    &lt;destinationPolicy&gt;
        &lt;policyMap&gt;
            &lt;policyEntries&gt;
                &lt;policyEntry topic="&gt;" &gt;
                    &lt;deadLetterStrategy&gt;
                        &lt;individualDeadLetterStrategy
                                queuePrefix="DLQ."
                                useQueueForQueueMessages="true" /&gt;
                    &lt;/deadLetterStrategy&gt;
                &lt;/policyEntry&gt;
                &lt;policyEntry queue="&gt;" &gt;
                    &lt;deadLetterStrategy&gt;
                        &lt;individualDeadLetterStrategy
                                queuePrefix="DLQ."
                                useQueueForQueueMessages="true" /&gt;
                    &lt;/deadLetterStrategy&gt;
                &lt;/policyEntry&gt;
            &lt;/policyEntries&gt;
        &lt;/policyMap&gt;
    &lt;/destinationPolicy&gt;
</code></pre>

<p>With this option and setting the maximumRetries in the connection URI (<code>jms.redeliveryPolicy.maximumRedeliveries=4</code>) or in code, I can configure the system quite well. </p>

<p>Yet, I would like to configure the default <code>redeliveryPolicy</code> settings for all connections, to enforce a standard over all applications within a broker. Individual application settings may vary, but as I see it currently, I cannot configure the default in the XML - or is there a way?</p>

<p>I tried to do this with redeliveryplugin, but my problem is, that this seems to work only for specific queues, not for all queues. I could not change the default RedeliveryPolicy with the plugin, also I could not remove the delays (minimum 1000):</p>

<pre><code>    &lt;plugins&gt;
        &lt;redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true"&gt;
            &lt;redeliveryPolicyMap&gt;
                &lt;redeliveryPolicyMap&gt;
                    &lt;defaultEntry&gt; 
                        &lt;redeliveryPolicy maximumRedeliveries="0" initialRedeliveryDelay="1001" redeliveryDelay="1001" /&gt;
                    &lt;/defaultEntry&gt; 
                &lt;/redeliveryPolicyMap&gt;                  
            &lt;/redeliveryPolicyMap&gt;
        &lt;/redeliveryPlugin&gt;
    &lt;/plugins&gt;
</code></pre>