FluxMessageChannel: try.catch not onErrorContinue
It turns out that some upstream fluxes may come with the `onErrorResume()` logic. The `onErrorContinue()` here downstream in the `FluxMessageChannel.java` eliminates an `onErrorResume()` purpose. * Change the logic to `try..catch` in the `doOnNext()` instead and let that upstream `onErrorResume()` to do its job
This commit is contained in:
@@ -78,8 +78,14 @@ public class FluxMessageChannel extends AbstractMessageChannel
|
||||
Flux.from(publisher)
|
||||
.delaySubscription(this.subscribedSignal.filter(Boolean::booleanValue).next())
|
||||
.publishOn(Schedulers.boundedElastic())
|
||||
.doOnNext(this::send)
|
||||
.onErrorContinue((ex, message) -> logger.warn("Error during processing event: " + message, ex))
|
||||
.doOnNext((message) -> {
|
||||
try {
|
||||
send(message);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.warn("Error during processing event: " + message, ex);
|
||||
}
|
||||
})
|
||||
.subscribe());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user