Keep original headers when build ErrorMessage in DefaultErrorMessageStrategy - #11160
Keep original headers when build ErrorMessage in DefaultErrorMessageStrategy#11160mjd507 wants to merge 1 commit into
DefaultErrorMessageStrategy#11160Conversation
…Strategy` Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
| if (inputMessage instanceof Message) { | ||
| return new ErrorMessage(throwable, (Message<?>) inputMessage); | ||
| if (inputMessage instanceof Message<?> message) { | ||
| return new ErrorMessage(throwable, message.getHeaders(), message); |
There was a problem hiding this comment.
OK. I don't see a harm in this, but still in consistency with our support and compatibility policy, we cannot accept this right now.
This is some kind of breaking change, so we aim it for the next minor 7.2 starting in August.
Please, consider to mention this in the class Javadoc.
Also describe such a logic in the dedicated Error Handling chapter of the doc: https://docs.spring.io/spring-integration/reference/error-handling.html.
When we switch to new version, we will also ask you to add a note about this change in the whats-new.adoc dedicated to that new 7.2 version.
Thank you!
artembilan
left a comment
There was a problem hiding this comment.
@mjd507 ,
We have switched recently to 7.2.
Please, consider to add a whats-new note into that General Changes sections.
Thanks
When setup
RequestHandlerRetryAdvicewith a recoverErrorMessageSendingRecoverer, after retry exhausted, theDefaultErrorMessageStrategywill build aErrorMessage, however it does not copy the original message headers.because I need the header values to do the error routing, so I think it is useful to keep it.