diff --git a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java index 5838ad7f9f..3d6d3a6e45 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/handler/AbstractMessageProducingHandler.java @@ -384,7 +384,14 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan reactiveReply .publishOn(Schedulers.boundedElastic()) - // TODO until Reactor supports context propagation from the MonoToCompletableFuture + /* + The MonoToCompletableFuture in Project Reactor does not support context propagation, + and it does not suppose to, since there is no guarantee how this Future is going to + be handled downstream. + However, in our case we process it directly in this class in the doProduceOutput() + via whenComplete() callback. So, when value is set into the Future, it is available + in the callback in the same thread immediately. + */ .doOnEach((signal) -> { try (AutoCloseable scope = IntegrationReactiveUtils .setThreadLocalsFromReactorContext(signal.getContextView())) {