You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bingliu <li...@gmail.com> on 2010/11/24 03:36:31 UTC

How throw Exception to Up route

Hi, I have some question.Now I use camel with spring. I definition two routes
called Route1 and Route2.Look this:
<camel:route id="route1" errorHandlerRef="handler">
<camel:from uri="direct:route1"/>
<camel:to uri="direct:rouet2"/>
</camel:route>

<camel:route id="rouet2">
<camel:from uri="direct:route2"/>
<camel:bean ref="someBean"/>
</camel:route>
I use a error handler on Route1.Now route2 throw an Exception.How can I
catch the Exception on Route1?How can I use the route1's errorHander catch
the Exception?
-- 
View this message in context: http://camel.465427.n5.nabble.com/How-throw-Exception-to-Up-route-tp3277800p3277800.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How throw Exception to Up route

Posted by Willem Jiang <wi...@gmail.com>.
On 11/24/10 1:34 PM, Bingliu wrote:
>
> Hi,willem.
> if I don't use the errorHandler in context scope.whether have a method make
> the exception throw up?
> Because I have defined many route in the context. Some route also throw
> exception,but need't use errorHandler.

You can configure the error handler per route as you did.


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Re: How throw Exception to Up route

Posted by Bingliu <li...@gmail.com>.
Hi,willem.
if I don't use the errorHandler in context scope.whether have a method make
the exception throw up?
Because I have defined many route in the context. Some route also throw
exception,but need't use errorHandler.
-- 
View this message in context: http://camel.465427.n5.nabble.com/How-throw-Exception-to-Up-route-tp3277800p3277914.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How throw Exception to Up route

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

CamelContext supports to set the ErrorHandler like this

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

On 11/24/10 10:36 AM, Bingliu wrote:
>
> Hi, I have some question.Now I use camel with spring. I definition two routes
> called Route1 and Route2.Look this:
> <camel:route id="route1" errorHandlerRef="handler">
> <camel:from uri="direct:route1"/>
> <camel:to uri="direct:rouet2"/>
> </camel:route>
>
> <camel:route id="rouet2">
> <camel:from uri="direct:route2"/>
> <camel:bean ref="someBean"/>
> </camel:route>
> I use a error handler on Route1.Now route2 throw an Exception.How can I
> catch the Exception on Route1?How can I use the route1's errorHander catch
> the Exception?


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang