Description
Gary Russell opened SPR-15459 and commented
In Spring Integration (and derivative projects such as Spring Cloud Stream), we have a need to add property inputMessage
or originalMessage
or similar to the ErrorMessage
.
Typically, the payload of an ErrorMessage
is a MessagingException
with a failedMessage
property containing the message at the point of failure.
The original message at the place in the stack where the exception is caught (and the ErrorMessage
created) may be different to the message at the point of failure - it may have gone through several transformations before the exception occurs.
In certain use cases, it would be useful to have access to both messages for error handling purposes. Hence the desire to add this property.
We can (and have) create a subclass for this, but are having a hard time coming up with a good name EnhancedErrorMessage
, ExtendedErrorMessage
etc.
So we wish to float the idea to add it to the core ErrorMessage
since it might be useful elsewhere.
If you concur, we'd be happy to issue a PR. It would be nice to have it in a 4.3.x release too, but we can live with our badly named subclass until 5.0 (or indefinitely if you don't want this in core messaging).
Issue Links:
- INT-2116 Support Capture of Original Inbound Message in ErrorMessage
Referenced from: pull request #1395, and commits c16c8f2, e93e49f, e677342