You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Minh Tran <mi...@winning.com.au> on 2014/04/11 04:53:45 UTC

exception handling across routes

Hi

I'm attempting to catch an exception thrown from another route as follows.

<route>
	<from uri="direct:one"/>
	<onException>
		<exception>BlahException</exception>
		<handled>
			<constant>true</constant>
		</handled>
		<to message="handled blah"/>
	</onException>
	<to uri="direct:two"/>
</route>

<route>
	<from uri="direct:two"/>
	<throwException ref="blahException"/>
</route>

Is this actually possible? The help pages at https://camel.apache.org/exception-clause.html don't cover this scenario. I don't really want to declare a global one either as I am going to have multiple routes dealing with BlahException slightly differently.

I am using 2.13.0. Thanks. 

Re: exception handling across routes

Posted by Minh Tran <mi...@winning.com.au>.
Solution was to use the no error handler on the inner route.

http://stackoverflow.com/questions/7407105/camel-exception-handling-in-sub-routes

On 11/04/2014, at 12:53 PM, Minh Tran <mi...@winning.com.au> wrote:

> Hi
> 
> I'm attempting to catch an exception thrown from another route as follows.
> 
> <route>
> 	<from uri="direct:one"/>
> 	<onException>
> 		<exception>BlahException</exception>
> 		<handled>
> 			<constant>true</constant>
> 		</handled>
> 		<to message="handled blah"/>
> 	</onException>
> 	<to uri="direct:two"/>
> </route>
> 
> <route>
> 	<from uri="direct:two"/>
> 	<throwException ref="blahException"/>
> </route>
> 
> Is this actually possible? The help pages at https://camel.apache.org/exception-clause.html don't cover this scenario. I don't really want to declare a global one either as I am going to have multiple routes dealing with BlahException slightly differently.
> 
> I am using 2.13.0. Thanks.