GH-9538: Rely on the customizeMonoReply() for thread switching
Fixes: https://github.com/spring-projects/spring-integration/issues/9538 Some applications might not be satisfied with `.publishOn(Schedulers.boundedElastic())` used by default for `Mono` replies. * Remove that `.publishOn(Schedulers.boundedElastic())` from the `AbstractMessageProducingHandler`. Instead, the target project is free to make a choice via `customizeMonoReply()`, e.g.: ``` .handle(RSockets.outboundGateway("/lowercase") .clientRSocketConnector(this.clientRSocketConnector), endpoint -> endpoint.customizeMonoReply((message, mono) -> mono.publishOn(Schedulers.boundedElastic()))) ```
This commit is contained in:
@@ -33,7 +33,6 @@ import org.reactivestreams.Publisher;
|
||||
import reactor.core.Exceptions;
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.scheduler.Schedulers;
|
||||
|
||||
import org.springframework.beans.factory.BeanCreationException;
|
||||
import org.springframework.beans.factory.BeanFactory;
|
||||
@@ -386,7 +385,6 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan
|
||||
CompletableFuture<Object> replyFuture = new CompletableFuture<>();
|
||||
|
||||
reactiveReply
|
||||
.publishOn(Schedulers.boundedElastic())
|
||||
/*
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user