Performance improvements related to SCST-2303

This commit is contained in:
Oleg Zhurakousky
2022-03-22 13:53:48 +01:00
parent 5ef56a90f0
commit 2ce45726ab

View File

@@ -1128,6 +1128,12 @@ public class SimpleFunctionRegistry implements FunctionRegistry {
if (!(output instanceof Publisher) && this.enhancer != null) {
output = enhancer.apply(output);
}
if (this.getTarget() instanceof PassThruFunction) { // scst-2303
Map<String, Object> headersMap = (Map<String, Object>) ReflectionUtils
.getField(SimpleFunctionRegistry.this.headersField, ((Message) output).getHeaders());
headersMap.put(MessageHeaders.CONTENT_TYPE, contentType[0]);
return messageConverter.toMessage(((Message) output).getPayload(), ((Message) output).getHeaders());
}
if (ObjectUtils.isEmpty(contentType) && !(output instanceof Publisher)) {
return output;