[ 
https://issues.apache.org/jira/browse/CAMEL-3989?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044847#comment-13044847
 ] 

Claus Ibsen commented on CAMEL-3989:
------------------------------------

That said. There is one interresting aspect when doing a
{code:xml}
<errorHandler type="DeadLetterChannel" id="myDLC" deadLetterUri="mock:dead">
      <redeliveryPolicy maximumRedeliveries="5" redeliveryDelay="1000" 
useCollisionAvoidance="true"/>
    </errorHandler>

  <onException>
    <exception>org.apache.camel.MyException</exception>
    <handled><constant>false</constant></handled>
  </onException>
{code}

eg we set handled=false, in the OnException for MyException. If the intention 
is to say that
a) okay by default use the Dead Letter Channel to handle exceptions
b) but for this special exception MyException, then *dont* use DLC but just 
regard it as not handled (eg its failed on the Exchange).

In case b (which I can see a good point for end user to expect) then there is a 
bug in trunk. However that's fairly easy to fix. I think we should change this 
in Camel to act like that. So if you have configured handled or any outputs on 
the <onException> then the DLC will not kick in.

> onException definition ignored when using route/@errorHandlerRef with the xml 
> dsl
> ---------------------------------------------------------------------------------
>
>                 Key: CAMEL-3989
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3989
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 2.7.1
>            Reporter: Hadrian Zbarcea
>            Assignee: Hadrian Zbarcea
>             Fix For: 2.8.0
>
>
> When using a route definition like below:
> {code}
> <camelContext xmlns="http://camel.apache.org/schema/spring";>
>   <onException>
>     <exception>org.apache.camel.MyException</exception>
>     <handled><constant>false</constant></handled>
>   </onException>
>   <route errorHandlerRef="errorHandler">
>     <from uri="direct:start"/>
> [...]
> {code}
> the onException definition is not propagated to the ref'd DLC and hence it 
> will be ignored.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to