You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Calvert, Zach (Zach)** CTR **" <zc...@motive.com> on 2012/11/07 18:09:05 UTC
Dead Letter Delivers Twice!?
I have a camel route that trips up an error in it. We have set up:
<!-- This defines the redelivery policy -->
<bean id="deliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="10"/>
<property name="redeliveryDelay" value="3000"/>
</bean>
<!-- This trigger redelivery or DLQ for a thrown exception -->
<bean id="deliveryErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="activeMQ:queue: deadletter"/>
<property name="redeliveryPolicy" ref=" deliveryPolicyConfig "/>
</bean>
And then our route is defined:
<camel:camelContext trace="true">
<camel:route errorHandlerRef="deliveryErrorHandler">
<camel:from uri="activeMQ:queue:deliveryqueue" />
<camel:to uri="bean:messageDeliver?method=throwException"/>
</camel:route>
<!-- This route consume messages from DeadLetterQueue and log them -->
<camel:route>
<camel:from uri="activeMQ:queue:deadletter"/>
<camel:inOnly uri="activeMQ:queue:stat" /> <!-- THIS GETS MESSAGED TWICE -->
</camel:route>
</camel:camelContext>
Now when I call it one time, triggering one initial run of the "activeMQ:queue:deliveryqueue" I get sent the same message twice to "activeMQ:queue:stat". I can't seem to find a bug against the DeadLetterChannelBuilder or anything else that would indicate a failure message is sent more than once on purpose. Is there a configuration piece I'm missing which will allow me to get the deadletter message only once?
Thanks,
Zach Calvert
RE: Dead Letter Delivers Twice!?
Posted by "Calvert, Zach (Zach)** CTR **" <zc...@motive.com>.
Yikes, nevermind. PEBKAC error.
-----Original Message-----
From: Calvert, Zach (Zach)** CTR ** [mailto:zcalvert@motive.com]
Sent: Wednesday, November 07, 2012 11:09 AM
To: users@camel.apache.org
Subject: Dead Letter Delivers Twice!?
I have a camel route that trips up an error in it. We have set up:
<!-- This defines the redelivery policy -->
<bean id="deliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="10"/>
<property name="redeliveryDelay" value="3000"/>
</bean>
<!-- This trigger redelivery or DLQ for a thrown exception -->
<bean id="deliveryErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="activeMQ:queue: deadletter"/>
<property name="redeliveryPolicy" ref=" deliveryPolicyConfig "/>
</bean>
And then our route is defined:
<camel:camelContext trace="true">
<camel:route errorHandlerRef="deliveryErrorHandler">
<camel:from uri="activeMQ:queue:deliveryqueue" />
<camel:to uri="bean:messageDeliver?method=throwException"/>
</camel:route>
<!-- This route consume messages from DeadLetterQueue and log them -->
<camel:route>
<camel:from uri="activeMQ:queue:deadletter"/>
<camel:inOnly uri="activeMQ:queue:stat" /> <!-- THIS GETS MESSAGED TWICE -->
</camel:route>
</camel:camelContext>
Now when I call it one time, triggering one initial run of the "activeMQ:queue:deliveryqueue" I get sent the same message twice to "activeMQ:queue:stat". I can't seem to find a bug against the DeadLetterChannelBuilder or anything else that would indicate a failure message is sent more than once on purpose. Is there a configuration piece I'm missing which will allow me to get the deadletter message only once?
Thanks,
Zach Calvert