SLEUTH-2051 Ensure that sleuth is not applied when reactive and non-message inputs are used

This commit is contained in:
Oleg Zhurakousky
2022-10-27 15:16:45 +02:00
parent b44984f59c
commit 62ffbc12b6

View File

@@ -40,7 +40,8 @@ public abstract class FunctionAroundWrapper implements BiFunction<Object, Functi
String functionalTracingEnabledStr = System.getProperty("spring.sleuth.function.enabled");
boolean functionalTracingEnabled = StringUtils.hasText(functionalTracingEnabledStr)
? Boolean.parseBoolean(functionalTracingEnabledStr) : true;
if (functionalTracingEnabled) {
if (functionalTracingEnabled && !targetFunction.isInputTypePublisher() &&
input instanceof Message && !FunctionTypeUtils.isCollectionOfMessage(targetFunction.getOutputType())) {
boolean isSkipOutputConversion = targetFunction.isSkipOutputConversion();
targetFunction.setSkipOutputConversion(true);
try {