You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by aram <an...@gmail.com> on 2013/04/18 14:38:29 UTC
DeadLetterChanel does not handle exception.
Hello.I have some problem with using DeadLetterChannel. Here is an example of
routes that shows the issue:
// configured error handler
<camel:errorHandler id="testErrorHandler" type="DeadLetterChannel"
useOriginalMessage="true"
deadLetterUri="jms:dlq?preserveMessageQos=true">
<camel:redeliveryPolicy logHandled="true" logStackTrace="true"
retriesExhaustedLogLevel="WARN" logExhausted="true"/>
</camel:errorHandler>
//producer route
<route id="receiveFromJms" errorHandlerRef="testErrorHandler">
<from
uri="jms:testJms?transactionManager=#platformTransactionManager"/>
<to uri="direct:sent" inheritErrorHandler="true"/>
</route>
//consuming route with exception
<route id="receiveFromDirect">
<from uri="direct:sent"/>
<onException>
<exception>java.io.IOException</exception>
<redeliveryPolicy maximumRedeliveries="3"
redeliveryDelay="100" />
<continued>
<constant>false</constant>
</continued>
</onException>
<throwException ref="java.io.IOException"/>
<to uri="log:finishTest"/>
</route>
I expect that by throwing an exception, the route will make redelivery
message 3 times, then send it to the specified deadLetterUri. But in fact it
turns out that the route make redelivery infinitely because of jms
transaction redelivery, and dont send it to the deadLetterUri. If i remove
onException it works fine , but without redelivery. Is it a bug or wrong
configuration ?
redeliveryTest.zip
<http://camel.465427.n5.nabble.com/file/n5731073/redeliveryTest.zip>
--
View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: DeadLetterChanel does not handle exception.
Posted by aram <an...@gmail.com>.
Change. But same result.
--
View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731075.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: DeadLetterChanel does not handle exception.
Posted by aram <an...@gmail.com>.
Thank you! It really helped to solve the problem.
--
View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731528.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: DeadLetterChanel does not handle exception.
Posted by Claus Ibsen <cl...@gmail.com>.
If you set handled(true) on your onException then that ought to fix
the issue you have.
On Wed, Apr 24, 2013 at 7:44 PM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> Yeah I can see this is a bug. I have logged a ticket. Thanks for
> reporting this problem to the community.
> https://issues.apache.org/jira/browse/CAMEL-6311
>
> On Tue, Apr 23, 2013 at 8:05 AM, aram <an...@gmail.com> wrote:
>> I tried it on a camel 2.11.0 , but there is the same problem :
>>
>> java.lang.AssertionError: mock://log:send Received message count. Expected:
>> <4> but was: <28>
>>
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731319.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: DeadLetterChanel does not handle exception.
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Yeah I can see this is a bug. I have logged a ticket. Thanks for
reporting this problem to the community.
https://issues.apache.org/jira/browse/CAMEL-6311
On Tue, Apr 23, 2013 at 8:05 AM, aram <an...@gmail.com> wrote:
> I tried it on a camel 2.11.0 , but there is the same problem :
>
> java.lang.AssertionError: mock://log:send Received message count. Expected:
> <4> but was: <28>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731319.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: DeadLetterChanel does not handle exception.
Posted by aram <an...@gmail.com>.
I tried it on a camel 2.11.0 , but there is the same problem :
java.lang.AssertionError: mock://log:send Received message count. Expected:
<4> but was: <28>
--
View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731319.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: DeadLetterChanel does not handle exception.
Posted by Christian Müller <ch...@gmail.com>.
Camel 2.11.0 is available since a few hours. Can you please try it with
this version? Only to make sure it also affects this version...
Best,
Christian
On Mon, Apr 22, 2013 at 3:01 PM, vladimirfx <vk...@citc.ru> wrote:
> Hi
>
> We are affected by same issue. Seams like regression from Camel 2.8.x, in
> witch routes with combination of DLQ EH and onException clauses (for fast
> redelivery) worked fine (we have many such routes in production).
> As now we can't upgrade to Camel 2.10 because of this issue.
> I've try to debug routes - no luck. Only strange thing that I figured out
> is:
>
> In RedeliveryErrorHandler when onException redeliveries is exhausted the
> RedeliveryData used by handleException() given from onException
> configuration instead of DeadLetterChannel. As result
> RedeliveryData.handledPredicate is invalid.
>
> Claus, point me please where to see to figure out cause of issue?
>
> Thank you!
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731251.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Re: DeadLetterChanel does not handle exception.
Posted by vladimirfx <vk...@citc.ru>.
Hi
We are affected by same issue. Seams like regression from Camel 2.8.x, in
witch routes with combination of DLQ EH and onException clauses (for fast
redelivery) worked fine (we have many such routes in production).
As now we can't upgrade to Camel 2.10 because of this issue.
I've try to debug routes - no luck. Only strange thing that I figured out
is:
In RedeliveryErrorHandler when onException redeliveries is exhausted the
RedeliveryData used by handleException() given from onException
configuration instead of DeadLetterChannel. As result
RedeliveryData.handledPredicate is invalid.
Claus, point me please where to see to figure out cause of issue?
Thank you!
--
View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073p5731251.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: DeadLetterChanel does not handle exception.
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
You should configure the 2nd route to also use the DL error handler.
On Thu, Apr 18, 2013 at 2:38 PM, aram <an...@gmail.com> wrote:
> Hello.I have some problem with using DeadLetterChannel. Here is an example of
> routes that shows the issue:
>
> // configured error handler
> <camel:errorHandler id="testErrorHandler" type="DeadLetterChannel"
> useOriginalMessage="true"
> deadLetterUri="jms:dlq?preserveMessageQos=true">
> <camel:redeliveryPolicy logHandled="true" logStackTrace="true"
> retriesExhaustedLogLevel="WARN" logExhausted="true"/>
> </camel:errorHandler>
>
> //producer route
> <route id="receiveFromJms" errorHandlerRef="testErrorHandler">
> <from
> uri="jms:testJms?transactionManager=#platformTransactionManager"/>
> <to uri="direct:sent" inheritErrorHandler="true"/>
> </route>
>
> //consuming route with exception
> <route id="receiveFromDirect">
> <from uri="direct:sent"/>
> <onException>
> <exception>java.io.IOException</exception>
> <redeliveryPolicy maximumRedeliveries="3"
> redeliveryDelay="100" />
> <continued>
> <constant>false</constant>
> </continued>
> </onException>
>
> <throwException ref="java.io.IOException"/>
> <to uri="log:finishTest"/>
> </route>
>
> I expect that by throwing an exception, the route will make redelivery
> message 3 times, then send it to the specified deadLetterUri. But in fact it
> turns out that the route make redelivery infinitely because of jms
> transaction redelivery, and dont send it to the deadLetterUri. If i remove
> onException it works fine , but without redelivery. Is it a bug or wrong
> configuration ?
> redeliveryTest.zip
> <http://camel.465427.n5.nabble.com/file/n5731073/redeliveryTest.zip>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/DeadLetterChanel-does-not-handle-exception-tp5731073.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen