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?
Asked
Active
Viewed 443 times
0
-
I would go with `super.configure()` - since you have no further need for a RouteBuilder once the route has been configured, using inheritance would be fine. – vikingsteve Feb 27 '14 at 09:40
-
@vikingsteve I am sure both of them will work fine. I dont see any reason why I would not choose Injecting a defaultRouteBuilder in all other routes. – Ayan Feb 27 '14 at 17:45
1 Answers
1
The global onException DSL only work inside of same RouteBuilder, as camelcontext treat the routebuilder instance separately.

Willem Jiang
- 3,291
- 1
- 14
- 14
-
are you telling that Injecting defaultRouteBuilder would cause issues as there are technically no routes defined in that RouteBuilder. Calling defaultRouteBuilder.configure() would not actually hook onException for routes in the ActualRouteBuilder where I inject the defaultRouteBuilder. Am I right ? – Ayan Mar 04 '14 at 18:02
-
I would have looked at the onException implementation before asking this Question. Thanks – Ayan Mar 05 '14 at 01:05