You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by simafengyun <27...@qq.com> on 2014/07/14 05:51:02 UTC

quesion about onException

Hi All,

In spring xml, we can configure onException for camelcontext level.
But in Java, I just see configure onException for route level. Is there
anyway to configure onException for camel context level in java?



--
View this message in context: http://camel.465427.n5.nabble.com/quesion-about-onException-tp5753767.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: quesion about onException

Posted by sunny <ra...@gmail.com>.
Hi Claus,

I have same query which simafengyun asked. 

I tried creating a base class (extending RouteBuilder) and have the global
onException in the configure method. I guess this is useful if there are
many Java DSL's. 
When I do this i see that onException is not available to routes in Camel
Context.

Is there anyway to configure onException for camel context level in java? I
am using Camel 2.10.0.




--
View this message in context: http://camel.465427.n5.nabble.com/quesion-about-onException-tp5753767p5763449.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: quesion about onException

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

In Java you can create a base abstract class (extending RouteBuilder)
and do the global onException etc. in the configure method.

And then for other routes, extend your base class, and call super.configure();

eg its just regular Java inheritance.

On Mon, Jul 14, 2014 at 5:51 AM, simafengyun <27...@qq.com> wrote:
> Hi All,
>
> In spring xml, we can configure onException for camelcontext level.
> But in Java, I just see configure onException for route level. Is there
> anyway to configure onException for camel context level in java?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/quesion-about-onException-tp5753767.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/