Injecting or Inheriting Router Builder for global onException in apache camel

506 Views Asked by At

I have onException configured in one DefaultRouteBuilder class. I want this onException in all other routes in my context. My doubt is whether I should inherit DefaultRouteBuilder in all other routes and calling super.configure() in configure() method or to inject DefaultRouteBuilder defaultRoute in all other RouteBuilder classes and calling defaultRoute.configure() in configure() method. Which one should be appropriate?

1

There are 1 best solutions below

2
Willem Jiang On BEST ANSWER

The global onException DSL only work inside of same RouteBuilder, as camelcontext treat the routebuilder instance separately.