GH-588 Fix dropped headers during input conversion
This addresses the issue of dropped Message headers in the event where input is a Message but input conversion is not necessary while Message contains headers that require explicit propagation (e.g., scf-sink-url, scf-func-name) Resolves #588
This commit is contained in:
@@ -777,8 +777,12 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
|
||||
}
|
||||
|
||||
Publisher<?> result = publisher instanceof Mono
|
||||
? Mono.from(publisher).map(value -> this.convertInputValueIfNecessary(value, type))
|
||||
: Flux.from(publisher).map(value -> this.convertInputValueIfNecessary(value, type));
|
||||
? Mono.from(publisher).map(value -> this.convertInputValueIfNecessary(value, type)).doOnError(v -> {
|
||||
v.printStackTrace();
|
||||
})
|
||||
: Flux.from(publisher).map(value -> this.convertInputValueIfNecessary(value, type)).doOnError(v -> {
|
||||
v.printStackTrace();
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -834,7 +838,9 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
|
||||
if (this.payloadIsSpecialType(((Message<?>) value).getPayload())) {
|
||||
return null;
|
||||
}
|
||||
convertedValue = ((Message<?>) convertedValue).getPayload();
|
||||
if (!((Message<?>) convertedValue).getHeaders().containsKey("scf-sink-url")) {
|
||||
convertedValue = ((Message<?>) convertedValue).getPayload();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (rawType instanceof Class<?>) { // see AWS adapter with WildardTypeImpl and Azure with Voids
|
||||
|
||||
Reference in New Issue
Block a user