Opinions on Request Handler Advice as an error handler
In the past, we've played around with using different tools to handle error in spring int flows, with mixed success.
- Error Gateways - Work as advertised, errors can route to the errorChannel. The downside is that they are a gateway so will sit a wait for a response. In flows that use outbound channel adapters, this requires some 'hackery' in the flow
- Inject JMS/AMQ queue - This puts a queue in the middle with an inbound channel adapter that can then route to an error handler. This works pretty well, and isn't horrible when you come down to looking at logical segments in your flows. But it is a pretty verbose way of doing things.
So, what about creating an ErrorHandlingAdvice class that can be injected into an endpoint that will wrap the error and send it to a configured error channel? I'm thinking something similar to the retry advice but one that doesn't actually do a retry, just wraps the message as an ErrorMessage like an error gateway and passes it down to an error channel.
I'm just starting to look at Message Handler Advice. Is this a good idea? Or am I trying to make it do something it isn't meant to do? I don't want to spend too much time diving into the mechanics if I'm missing some basic premise of the new Advice feature.