Details
-
Bug
-
Resolution: Done
-
Major
-
2.12.0.redhat-61379
-
None
-
None
Description
When using a recipient list contained in a doTry/doCatch, the error handling of the doTry/doCatch is ignored and the exception is handled by the global error handler.
The following is a sample route:
<onException> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <log message="GLOBAL error handling"/> <setBody> <constant>Global error handling</constant> </setBody> </onException> <route id="router"> <from uri="direct:inner-router"/> <log message="parameter IN: ${header.useHandler}"/> <doTry> <log message="trying...."/> <when> <simple>${header.useCamelRouter} == 'recipient-list'</simple> <setProperty propertyName="destination"> <constant>direct:force-error</constant> </setProperty> <camel:recipientList> <simple>${property.destination}</simple> </camel:recipientList> </when> <when> <simple>${header.useCamelRouter} == 'to'</simple> <to uri="direct:force-error"/> </when> <doCatch> <exception>java.lang.Exception</exception> <handled><constant>true</constant></handled> <setBody> <constant>Try-Catch error handling</constant> </setBody> </doCatch> </doTry> </route>
When the route is executed using the recipient list the exception get handled by the global error handler rather than using the doTry/doCatch error handler.