Changes for consumer

This commit is contained in:
Marcin Grzejszczak
2021-10-13 15:35:55 +02:00
committed by Oleg Zhurakousky
parent e32482ed39
commit 4c7dfa7a73

View File

@@ -34,14 +34,13 @@ import org.springframework.messaging.Message;
*/
public abstract class FunctionAroundWrapper implements BiFunction<Object, FunctionInvocationWrapper, Object> {
@SuppressWarnings("unchecked")
@Override
public final Object apply(Object input, FunctionInvocationWrapper targetFunction) {
boolean isSkipOutputConversion = targetFunction.isSkipOutputConversion();
targetFunction.setSkipOutputConversion(true);
Object result = null;
if (input instanceof Message || targetFunction.isOutputTypePublisher()) {
if (input instanceof Message || targetFunction.isOutputTypePublisher() || targetFunction.isInputTypePublisher()) {
return this.doApply(input, targetFunction);
}
else if (targetFunction.isSupplier() && !targetFunction.isOutputTypePublisher()) {