Fix AbstractMProducingHandler for ReactiveAdapter
Turns out there is a reactive adapter for `CompletableFuture` which is not an intention of the further logic
This commit is contained in:
@@ -310,11 +310,16 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.async) {
|
if (this.async) {
|
||||||
ReactiveAdapter reactiveAdapter = ReactiveAdapterRegistry.getSharedInstance().getAdapter(null, reply);
|
boolean isFutureReply =
|
||||||
if (reply instanceof org.springframework.util.concurrent.ListenableFuture<?>
|
reply instanceof org.springframework.util.concurrent.ListenableFuture<?> ||
|
||||||
|| reply instanceof CompletableFuture<?>
|
reply instanceof CompletableFuture<?>;
|
||||||
|| reactiveAdapter != null) {
|
|
||||||
|
|
||||||
|
ReactiveAdapter reactiveAdapter = null;
|
||||||
|
if (!isFutureReply) {
|
||||||
|
reactiveAdapter = ReactiveAdapterRegistry.getSharedInstance().getAdapter(null, reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFutureReply || reactiveAdapter != null) {
|
||||||
if (replyChannel instanceof ReactiveStreamsSubscribableChannel reactiveStreamsSubscribableChannel) {
|
if (replyChannel instanceof ReactiveStreamsSubscribableChannel reactiveStreamsSubscribableChannel) {
|
||||||
Publisher<?> reactiveReply = toPublisherReply(reply, reactiveAdapter);
|
Publisher<?> reactiveReply = toPublisherReply(reply, reactiveAdapter);
|
||||||
reactiveStreamsSubscribableChannel
|
reactiveStreamsSubscribableChannel
|
||||||
|
|||||||
Reference in New Issue
Block a user