Skip to content

Commit

Permalink
GH-3276: reactive inbound: Fix onErrorResume
Browse files Browse the repository at this point in the history
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`
  • Loading branch information
artembilan authored and garyrussell committed May 13, 2020
1 parent 7905658 commit bf0260a
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -643,7 +643,8 @@ private Mono<Message<?>> doSendAndReceiveMessageReactive(MessageChannel requestC
sendMessageForReactiveFlow(requestChannel, requestMessage);

return buildReplyMono(requestMessage, replyChan.replyMono, error, originalReplyChannelHeader,
originalErrorChannelHeader);
originalErrorChannelHeader)
.onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
});
}

Expand Down Expand Up @@ -693,8 +694,7 @@ private Mono<Message<?>> buildReplyMono(Message<?> requestMessage, Mono<Message<
.setHeader(MessageHeaders.ERROR_CHANNEL, originalErrorChannelHeader)
.build();
}
})
.onErrorResume(t -> error ? Mono.error(t) : handleSendError(requestMessage, t));
});
}

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

0 comments on commit bf0260a

Please sign in to comment.