Skip to content

Commit 619c5bf

Browse files
artembilangaryrussell
authored andcommitted
GH-3276: reactive inbound: Fix onErrorResume
Fixes #3276 The `onErrorResume` for the `MessagingGatewaySupport.doSendAndReceiveMessageReactive()` was in wrong place: only for the `buildReplyMono` which works only when an outbound flow is fully based on reactive channels. With a regular direct channel we can get an exception from the `sendMessageForReactiveFlow` which is not covered with the mentioned `onErrorResume` for the error handling on the configured `errorChannel` Cherry-pick to `5.2.x & 5.1.x`
1 parent 7cfab7b commit 619c5bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ private Mono<Message<?>> doSendAndReceiveMessageReactive(MessageChannel requestC
636636
sendMessageForReactiveFlow(requestChannel, requestMessage);
637637

638638
return buildReplyMono(requestMessage, replyChan.replyMono, error, originalReplyChannelHeader,
639-
originalErrorChannelHeader);
639+
originalErrorChannelHeader)
640+
.onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
640641
});
641642
}
642643

@@ -686,8 +687,7 @@ private Mono<Message<?>> buildReplyMono(Message<?> requestMessage, Mono<Message<
686687
.setHeader(MessageHeaders.ERROR_CHANNEL, originalErrorChannelHeader)
687688
.build();
688689
}
689-
})
690-
.onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
690+
});
691691
}
692692

693693
private Mono<Message<?>> handleSendError(Message<?> requestMessage, Throwable exception) {

0 commit comments

Comments
 (0)