Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.8.0
-
None
-
None
-
Unknown
Description
Currently we have some lees than optimal designs in camel:
The api and spi reference ErrorHandlerbuilder which is a builder level interface. As the builder needs access to almost anything this creates a big cycle over all of camel.
We also use the ErrorHandlerBuilder in many places where no build is necessary. In these cases rather a factory is needed.
The last thing is that we allow to change the ErrorHandlerBuilder in ProcessDefintion. So it can be set everywhere though it really should only be set on the start of a RouteDefinition.
So I propose to change several things:
- Create an interface ErrorHandlerFactory that only has the create method and use it instead of ErrorHandlerBuilder where no builder is needed
- Remove ErrorHandlerBuilder in ProcessDefintion and only have it in RouteDefintion
The first part should be made compatible using deprecation so people will not be affected.
The second part is incompatible but I doubt many people use the errorhandler outside the start of a Route. So I think we need to compatiblity measures.