Revert Incorrect MessagingTemplate Change

The change to "optimize" the template by not rebuilding the reply
message when the original header channels was null was incorrect.

We need to null out those headers if they were originally null.

Issue: SPR-15991
This commit is contained in:
Gary Russell 2017-05-31 12:30:11 -04:00 committed by Rossen Stoyanchev
parent c3e6afb879
commit f9b319d3ba
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ public class GenericMessagingTemplate extends AbstractDestinationResolvingMessag
}
Message<?> replyMessage = this.doReceive(tempReplyChannel, receiveTimeout);
if (replyMessage != null && (originalReplyChannelHeader!= null || originalErrorChannelHeader != null)) {
if (replyMessage != null) {
replyMessage = MessageBuilder.fromMessage(replyMessage)
.setHeader(MessageHeaders.REPLY_CHANNEL, originalReplyChannelHeader)
.setHeader(MessageHeaders.ERROR_CHANNEL, originalErrorChannelHeader)