GH-2113 Add safety check and create Message if necessary
. . . when sending data using template and the data is not a Message Resolves #2113
This commit is contained in:
@@ -586,6 +586,9 @@ public class FunctionConfiguration {
|
||||
outputChannel.send(((Message<?>) result));
|
||||
}
|
||||
else if (StringUtils.hasText(outputChannelName)) {
|
||||
if (!(result instanceof Message)) {
|
||||
result = MessageBuilder.withPayload(result).copyHeadersIfAbsent(requestMessage.getHeaders()).build();
|
||||
}
|
||||
template.send(outputChannelName, (Message<?>) result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user