I use java implementation for Camel. Should I use different class for each route I configure or use one common class to configure them all?
Asked
Active
Viewed 388 times
1 Answers
1
generally, I use a RouteBuilder class to configure functionally related routes, but the granularity is entirely up to you.
One other thing to consider is that the exception handling is specific to each RouteBuilder...
see this question for more details on this: Camel Exception handling doesnt work if exception clause is defined in a separate class
-
The exception handling is a good point. It might even be the case that you want different exception handlers for the same errors in different routes. Then separate classes is the way to go. So there are some constraints to look at. Not very many though. – Petter Nordlander May 05 '12 at 09:55