Problem: Having declared both transport and business-level (custom) transformers on the endpoint, it's not always clear whether service or connector exception strategy would be invoked in case of a failure for such mixed set.
Solution: Exception handling code can be made smarter:
- Transport transformers can implement a marker interface like HandleByConnectorExceptionStrategy
- Custom transformers will not change, and by convention will be considered for handling by a service exception strategy
- applyAllTransformers() catch block will dig into TransformerException to see which transformer exactly caused an issue (probably all info is already there, otherwise just pass in 'this' ref from transformer when throwing exception).
- Next, either connector.handleException() or service.handleException() should be invoked
There could be cases when more customization would be needed, but this is the first step to make it possible later.