You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Andreas Asmuss <an...@gmail.com> on 2010/07/20 13:17:18 UTC

possible onException bug when using routeContext

Hi

I have two routes in a routecontext. Both share an errorhandler but one of
the routes has a special exception clause. These routes works as expected
when defined directly in a camelContext, but when imported from a
routeContext, behaviour is flawed. In the routes below route2 "inherits" the
onException behaviour of route1 when route1 is defined after route2 (and
therefore route1 is started latest).

If I change the startup order the routes will behave as expected. It also
works if they both have onException behaviour on the same exception.

<routeContext id="routeCtx" xmlns="http://camel.apache.org/schema/spring">
	<route id="route2" errorHandlerRef="deadLetterErrorHandler">
		<from uri="file:test/2/in" />
		<throwException ref="Exception" />
		<to uri="file:test/2/out" />
	</route>

	<route id="route1" errorHandlerRef="deadLetterErrorHandler">
		<from uri="file:test/1/in" />
		<onException>
			<exception>java.lang.Exception</exception>
			<handled>
				<constant>true</constant>
			</handled>
			<to uri="file:test/1/onex" />
		</onException>
		<throwException ref="Exception" />
		<to uri="file:test/1/out" />
	</route>
</routeContext>
-- 
View this message in context: http://camel.465427.n5.nabble.com/possible-onException-bug-when-using-routeContext-tp1616244p1616244.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: possible onException bug when using routeContext

Posted by Andreas Asmuss <an...@gmail.com>.
Hi

Created a ticket an attached a sample case:

https://issues.apache.org/activemq/browse/CAMEL-2972
-- 
View this message in context: http://camel.465427.n5.nabble.com/possible-onException-bug-when-using-routeContext-tp1616244p1618526.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: possible onException bug when using routeContext

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Could you create a JIRA ticket

On Tue, Jul 20, 2010 at 1:17 PM, Andreas Asmuss <an...@gmail.com> wrote:
>
> Hi
>
> I have two routes in a routecontext. Both share an errorhandler but one of
> the routes has a special exception clause. These routes works as expected
> when defined directly in a camelContext, but when imported from a
> routeContext, behaviour is flawed. In the routes below route2 "inherits" the
> onException behaviour of route1 when route1 is defined after route2 (and
> therefore route1 is started latest).
>
> If I change the startup order the routes will behave as expected. It also
> works if they both have onException behaviour on the same exception.
>
> <routeContext id="routeCtx" xmlns="http://camel.apache.org/schema/spring">
>        <route id="route2" errorHandlerRef="deadLetterErrorHandler">
>                <from uri="file:test/2/in" />
>                <throwException ref="Exception" />
>                <to uri="file:test/2/out" />
>        </route>
>
>        <route id="route1" errorHandlerRef="deadLetterErrorHandler">
>                <from uri="file:test/1/in" />
>                <onException>
>                        <exception>java.lang.Exception</exception>
>                        <handled>
>                                <constant>true</constant>
>                        </handled>
>                        <to uri="file:test/1/onex" />
>                </onException>
>                <throwException ref="Exception" />
>                <to uri="file:test/1/out" />
>        </route>
> </routeContext>
> --
> View this message in context: http://camel.465427.n5.nabble.com/possible-onException-bug-when-using-routeContext-tp1616244p1616244.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: possible onException bug when using routeContext

Posted by Andreas Asmuss <an...@gmail.com>.
Actually I'm not sure if startuporder has anything to do with it, or if it's
just the physical placement in the .xml file.
-- 
View this message in context: http://camel.465427.n5.nabble.com/possible-onException-bug-when-using-routeContext-tp1616244p1616574.html
Sent from the Camel - Users mailing list archive at Nabble.com.