Can you move the DLC <errorHandler> definition inside the <route> please
and make a test ?


On Wed, Jan 22, 2014 at 8:19 PM, bocamel <johnz...@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.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to