You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Muhammad Ichsan <ic...@gmail.com> on 2010/03/10 12:28:42 UTC

How to propagate exception?

Hi All

Based on the following routes:

<route>
	<from uri="direct:message/>

	<onException>
		<exception>my.fragile.Exception</exception>
		<to uri="mock:isItPossibleToCatchHere"/>
	</onException>
	
	<to uri="direct:methodInvocation"/>
</route>

<route>
	<from uri="direct:methodInvocation"/>
	<to uri="bean:fragileBean?method=invokeWithPossibleException"/>
</route>

Is it possible to use the <onException> tag there?

Thanks

-- 
~The best men are men who benefit to others
http://michsan.web.id

Yang berkualitas memang beda rasanya!
http://rizqi-cookies.com

Re: How to propagate exception?

Posted by Norman Maurer <no...@googlemail.com>.
Camel in Action is a really great book. I purchased the MEAP version
and it really worth the money!

Bye,
Norman


2010/3/10 Claus Ibsen <cl...@gmail.com>:
> On Wed, Mar 10, 2010 at 12:28 PM, Muhammad Ichsan <ic...@gmail.com> wrote:
>> Hi All
>>
>> Based on the following routes:
>>
>> <route>
>>        <from uri="direct:message/>
>>
>>        <onException>
>>                <exception>my.fragile.Exception</exception>
>>                <to uri="mock:isItPossibleToCatchHere"/>
>>        </onException>
>>
>>        <to uri="direct:methodInvocation"/>
>> </route>
>>
>> <route>
>>        <from uri="direct:methodInvocation"/>
>>        <to uri="bean:fragileBean?method=invokeWithPossibleException"/>
>> </route>
>>
>> Is it possible to use the <onException> tag there?
>>
>
> Yes its a route scoped onException then.
> You can also set it as a CamelContext scoped instead (think global).
>
> Chapter 5 in the Camel in Action books covers really well about Camel
> error handling, which has many features.
> The wiki pages at Apache is IMHO full of details but I think it lacks
> a good picture and to guide you through the subject
> so you would understand it.
> http://www.manning.com/ibsen
>
> You can start here
> http://camel.apache.org/error-handling-in-camel.html
>
>
>
>> Thanks
>>
>> --
>> ~The best men are men who benefit to others
>> http://michsan.web.id
>>
>> Yang berkualitas memang beda rasanya!
>> http://rizqi-cookies.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: How to propagate exception?

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Mar 10, 2010 at 12:28 PM, Muhammad Ichsan <ic...@gmail.com> wrote:
> Hi All
>
> Based on the following routes:
>
> <route>
>        <from uri="direct:message/>
>
>        <onException>
>                <exception>my.fragile.Exception</exception>
>                <to uri="mock:isItPossibleToCatchHere"/>
>        </onException>
>
>        <to uri="direct:methodInvocation"/>
> </route>
>
> <route>
>        <from uri="direct:methodInvocation"/>
>        <to uri="bean:fragileBean?method=invokeWithPossibleException"/>
> </route>
>
> Is it possible to use the <onException> tag there?
>

Yes its a route scoped onException then.
You can also set it as a CamelContext scoped instead (think global).

Chapter 5 in the Camel in Action books covers really well about Camel
error handling, which has many features.
The wiki pages at Apache is IMHO full of details but I think it lacks
a good picture and to guide you through the subject
so you would understand it.
http://www.manning.com/ibsen

You can start here
http://camel.apache.org/error-handling-in-camel.html



> Thanks
>
> --
> ~The best men are men who benefit to others
> http://michsan.web.id
>
> Yang berkualitas memang beda rasanya!
> http://rizqi-cookies.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