From d4aa4f0e41cc796b6b6a6f69a801efef1ebacf54 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Wed, 2 Feb 2022 12:07:55 -0500 Subject: [PATCH] Remove skipConversion in FunctionAroundWrapper Currently, the `FunctionAroundWrapper` set `targetFunction.setSkipOutputConversion(true);` which is not what expected by the `TraceFunctionAroundWrapper`. This one has a logic based on the `Message` as an output from the target function and its headers to correlate tracing headers. * Remove the `setSkipOutputConversion(true)` from the `FunctionAroundWrapper` to satisfy `TraceFunctionAroundWrapper` expectation - we cannot enforce all the end-user function to always return a `Message` for us. * Some other refactoring in the `FunctionAroundWrapper` for cleaner code **Cherry-pick to `3.2.x`** --- .../catalog/FunctionAroundWrapper.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionAroundWrapper.java b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionAroundWrapper.java index 49ff7454a..9fe1f4773 100644 --- a/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionAroundWrapper.java +++ b/spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/FunctionAroundWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2020-2020 the original author or authors. + * Copyright 2020-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,10 +27,11 @@ import org.springframework.util.StringUtils; * If registered as bean it will be autowired into {@link FunctionInvocationWrapper}. * Keep in mind that it only affects imperative invocations where input is {@link Message} * - * NOTE: This API is experimental and and could change without notice. It is + * NOTE: This API is experimental and could change without notice. It is * intended for internal use only (e.g., spring-cloud-sleuth) * * @author Oleg Zhurakousky + * @author Artem Bilan * @since 3.1 */ public abstract class FunctionAroundWrapper implements BiFunction { @@ -38,17 +39,10 @@ public abstract class FunctionAroundWrapper implements BiFunction