You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dmitriyC300 <dm...@gmail.com> on 2016/05/24 13:38:46 UTC

Dynamically continue route on exception

Hi Guys,
I have a use case where I'd like to have route proceed on exception.  I know
we can use continued at the time we configure the route.  But what is the
best way to instruct the route to proceed on exception dynamically at
runtime? Is try/catch the only option at this time?

static:
onException(Exception.class).process(...).continued(true)

Nice to have:
onException(Exception.class).process(...).continued(simple("${property.continueOnException}"))

Full use case:
from("route1").process("route3?continueOnException=true").process(process1).end();
from("route2").process("route3?continueOnException=false").process(process2).end();
from("route3").onException(Exception.class).continue(simple("${property.continueOnException}")).end().process(process3).end();

Dmitriy



--
View this message in context: http://camel.465427.n5.nabble.com/Dynamically-continue-route-on-exception-tp5783038.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dynamically continue route on exception

Posted by dmitriyC300 <dm...@gmail.com>.
duh - not sure how i missed it.

thanks!



--
View this message in context: http://camel.465427.n5.nabble.com/Dynamically-continue-route-on-exception-tp5783038p5783050.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Dynamically continue route on exception

Posted by Quinn Stevenson <qu...@pronoia-solutions.com>.
You’re not limited to a constant with continued - you can use an Expression or a Predicate.

> On May 24, 2016, at 7:38 AM, dmitriyC300 <dm...@gmail.com> wrote:
> 
> Hi Guys,
> I have a use case where I'd like to have route proceed on exception.  I know
> we can use continued at the time we configure the route.  But what is the
> best way to instruct the route to proceed on exception dynamically at
> runtime? Is try/catch the only option at this time?
> 
> static:
> onException(Exception.class).process(...).continued(true)
> 
> Nice to have:
> onException(Exception.class).process(...).continued(simple("${property.continueOnException}"))
> 
> Full use case:
> from("route1").process("route3?continueOnException=true").process(process1).end();
> from("route2").process("route3?continueOnException=false").process(process2).end();
> from("route3").onException(Exception.class).continue(simple("${property.continueOnException}")).end().process(process3).end();
> 
> Dmitriy
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Dynamically-continue-route-on-exception-tp5783038.html
> Sent from the Camel - Users mailing list archive at Nabble.com.