Clean up applicability of FunctionAroundWraapper
This commit is contained in:
@@ -40,8 +40,7 @@ public abstract class FunctionAroundWrapper implements BiFunction<Object, Functi
|
|||||||
String functionalTracingEnabledStr = System.getProperty("spring.sleuth.function.enabled");
|
String functionalTracingEnabledStr = System.getProperty("spring.sleuth.function.enabled");
|
||||||
boolean functionalTracingEnabled = StringUtils.hasText(functionalTracingEnabledStr)
|
boolean functionalTracingEnabled = StringUtils.hasText(functionalTracingEnabledStr)
|
||||||
? Boolean.parseBoolean(functionalTracingEnabledStr) : true;
|
? Boolean.parseBoolean(functionalTracingEnabledStr) : true;
|
||||||
if (functionalTracingEnabled && !targetFunction.isInputTypePublisher() &&
|
if (functionalTracingEnabled && input instanceof Message) {
|
||||||
input instanceof Message && !FunctionTypeUtils.isCollectionOfMessage(targetFunction.getOutputType())) {
|
|
||||||
boolean isSkipOutputConversion = targetFunction.isSkipOutputConversion();
|
boolean isSkipOutputConversion = targetFunction.isSkipOutputConversion();
|
||||||
targetFunction.setSkipOutputConversion(true);
|
targetFunction.setSkipOutputConversion(true);
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -272,7 +272,8 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
|
|||||||
*/
|
*/
|
||||||
private FunctionInvocationWrapper wrapInAroundAdviceIfNecessary(FunctionInvocationWrapper function) {
|
private FunctionInvocationWrapper wrapInAroundAdviceIfNecessary(FunctionInvocationWrapper function) {
|
||||||
FunctionInvocationWrapper wrappedFunction = function;
|
FunctionInvocationWrapper wrappedFunction = function;
|
||||||
if (function != null && this.functionAroundWrapper != null) {
|
if (function != null && this.functionAroundWrapper != null && !function.isSupplier()
|
||||||
|
&& !function.isInputTypePublisher() && !function.isOutputTypePublisher() && !FunctionTypeUtils.isCollectionOfMessage(function.getOutputType())) {
|
||||||
wrappedFunction = new FunctionInvocationWrapper(function) {
|
wrappedFunction = new FunctionInvocationWrapper(function) {
|
||||||
@Override
|
@Override
|
||||||
Object doApply(Object input) {
|
Object doApply(Object input) {
|
||||||
|
|||||||
Reference in New Issue
Block a user