activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dtserekhman <dtserekh...@iqnavigator.com>
Subject redeliveryPlugin in broker specification in activemq.xml has no effect
Date Fri, 17 May 2013 18:06:28 GMT
Hi,

I'm using ActiveMQ 5.8.0 and trying to define a global default
ReliveryPolicy on the AMQ's broker by defining the following
redeliveryPlugin in <apache-activemq-5.8.0>/conf/activemq.xml inside of the
<broker>…</broker> tags.

<broker xmlns="http://activemq.apache.org/schema/core"
brokerName="localhost" dataDirectory="${activemq.data}"
schedulerSupport="true">
	……..
	……..
	……..

<plugins>
    <redeliveryPlugin fallbackToDeadLetter="true"
sendToDlqIfMaxRetriesExceeded="true">
        <redeliveryPolicyMap>
            <redeliveryPolicyMap>
                
                <defaultEntry>
                    <redeliveryPolicy maximumRedeliveries="4"
useExponentialBackOff="true" backOffMultiplier="2"
initialRedeliveryDelay="5000" redeliveryDelay="7000" />
                </defaultEntry>
            </redeliveryPolicyMap>
        </redeliveryPolicyMap>
    </redeliveryPlugin>
</plugins>

</broker> 

Please note that I do specify schedulerSupport="true" on the broker as per
documentation when using redeliveryPlugin.

However, my </defaultEntry> redeliveryPolicy has no effect. I'm still
observing regular default number of redeliveries being 6.

Here's my client-side camel blueprint specification which defines
ActiveMQConnectionFactory.

<bean id="pooledConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL"
value="nio://localhost:61616?jms.prefetchPolicy.all=1"/>
        <property name="userName" value="${username}"/>
        <property name="password" value="${password}"/>
</bean>

ActiveMQConnectionFactory has its RedeliveryPolicyMap which I can see
already gets initialized with its own default RedeliveryPolicy entry (which
specifies 6 redeliveries). I wonder if this overrides my global redelivery
specification on the broker side? 

So, I went ahead and set defaultEntry on the ActiveMQConnectionFactory on
the client side to null: 

activeMQConnectionFactory .getRedeliveryPolicyMap().setDefaultEntry(null);

After this I did see the number of redeliveries executed as specified in my
broker's redeliveryPlugin; however, I did not see the delay timings to
execute as expected. Delays between all the redeliveries were all 5 seconds
as specified by the "initialRedeliveryDelay" property. But since I was
setting useExponentialBackOff="true" backOffMultiplier="2"  and
redeliveryDelay="7000", I was expecting to see longer delay on each
subsequent redelivery. Why is the delay specification not working as
expected?

So, is overriding default RedeliveryPolicy to null on the client side the
only way of how we can push redeliveryPolicy specification from the broker?
Is there any better way of achieving this?

Thanks,
Dmitriy.



--
View this message in context: http://activemq.2283324.n4.nabble.com/redeliveryPlugin-in-broker-specification-in-activemq-xml-has-no-effect-tp4667163.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message