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

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

Ah okay the issue you have is that the onException doesn't do anything.
{code:xml}

<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       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="myFail" class="java.lang.IllegalArgumentException">
    <constructor-arg index="0" value="Damn"/>
  </bean>

  <camelContext xmlns="http://camel.apache.org/schema/spring";>

    <errorHandler type="DeadLetterChannel" id="myDLC" 
deadLetterUri="mock:dead"/>

    <onException>
      <exception>java.lang.IllegalArgumentException</exception>
      <handled>
        <constant>false</constant>
      </handled>
    </onException>

    <route errorHandlerRef="myDLC">
      <from uri="direct:start"/>
      <to uri="mock:a"/>
      <throwException ref="myFail"/>
    </route>
  </camelContext>

</beans>
{code}

So with that above, it gets into the DLC. And in your case you would expect it 
to be not handled at all, and the Exchange to fail?

> 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