Skip to content

Commit 5ef737a

Browse files
committed
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` # Conflicts: # spring-integration-core/src/main/java/org/springframework/integration/gateway/MessagingGatewaySupport.java
1 parent f759f0b commit 5ef737a

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
@@ -620,7 +620,8 @@ private Mono<Message<?>> doSendAndReceiveMessageReactive(MessageChannel requestC
620620
sendMessageForReactiveFlow(requestChannel, requestMessage);
621621

622622
return buildReplyMono(requestMessage, replyChan, error, originalReplyChannelHeader,
623-
originalErrorChannelHeader);
623+
originalErrorChannelHeader)
624+
.onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
624625
});
625626
}
626627

@@ -670,8 +671,7 @@ private Mono<Message<?>> buildReplyMono(Message<?> requestMessage, FutureReplyCh
670671
.setHeader(MessageHeaders.ERROR_CHANNEL, originalErrorChannelHeader)
671672
.build();
672673
}
673-
})
674-
.onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
674+
});
675675
}
676676

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

0 commit comments

Comments
 (0)