camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Dead letter queue and onException
Date Thu, 23 Jan 2014 08:22:17 GMT
What Camel version do you use?

On Wed, Jan 22, 2014 at 8:19 PM, bocamel <johnzyin@gmail.com> wrote:
> It seems that whenever an error is caught by onException, regardless whether
> handled is set to true or false, the failed message would not be written to
> the dead letter queue.  Here is a sample project to demonstrate this:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xmlns:camel="http://camel.apache.org/schema/spring"
>        xsi:schemaLocation="
>        http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>        http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>
>   <bean id="throwException"
> class="com.pci.FileDeadChannel.ThrowExceptionProcessor" />
>
>   <camel:camelContext xmlns="http://camel.apache.org/schema/spring"
> trace="true" handleFault="true" errorHandlerRef="dlc">
>
>                 <camel:errorHandler id="dlc" type="DeadLetterChannel"
> deadLetterUri="file:log/dead">
>                         <camel:redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="5000"
> retryAttemptedLogLevel="WARN"
>                                 logHandled="true"/>
>                 </camel:errorHandler>
>
>                 <camel:onException>
>                         <camel:exception>java.lang.RuntimeException</camel:exception>
>                         <camel:redeliveryPolicy maximumRedeliveries="3" redeliveryDelay="10000"
> />
>                         <camel:handled><camel:constant>false</camel:constant></camel:handled>
>                         <camel:log message="***** onException: ValidationException
*****" />
>                 </camel:onException>
>
>     <camel:route>
>       <camel:from uri="file:src/data?noop=true"/>
>       <camel:process ref="throwException" />
>     </camel:route>
>   </camel:camelContext>
>
> </beans>
>
> Is this correct?  Is there a way to add some configuration in the
> onException to still use the dead letter queue?
>
> Thanks!
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dead-letter-queue-and-onException-tp5746362.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Mime
View raw message