Fix Message unwrapping condition

This commit is contained in:
Oleg Zhurakousky
2020-05-07 09:26:58 +02:00
parent 10e9350697
commit 07e4de71d2

View File

@@ -47,7 +47,6 @@ import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.util.function.Tuples;
import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.support.AopUtils;
import org.springframework.beans.factory.BeanFactory;
@@ -75,6 +74,8 @@ import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
/**
*
* Basic implementation of FunctionRegistry which maintains the cache of registered functions while
@@ -532,7 +533,9 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
private Object invokeFunction(Object input) {
Message incomingMessage = null;
if (!this.functionDefinition.startsWith(RoutingFunction.FUNCTION_NAME)) {
if (input instanceof Message && !FunctionTypeUtils.isMessage(FunctionTypeUtils.getInputType(functionType, 0))) {
if (input instanceof Message
&& !FunctionTypeUtils.isMessage(FunctionTypeUtils.getInputType(functionType, 0))
&& ((Message) input).getHeaders().containsKey("scf-func-name")) {
incomingMessage = (Message) input;
input = incomingMessage.getPayload();
}