Equalize copy of ChannelSendOperator

See gh-23175
master
Rossen Stoyanchev 5 years ago
parent 030caea9cf
commit 003247dc40
  1. 10
      spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/reactive/ChannelSendOperator.java

@ -246,7 +246,15 @@ class ChannelSendOperator<T> extends Mono<Void> implements Scannable {
else if (this.state == State.NEW) {
this.completed = true;
this.state = State.FIRST_SIGNAL_RECEIVED;
writeFunction.apply(this).subscribe(this.writeCompletionBarrier);
Publisher<Void> result;
try {
result = writeFunction.apply(this);
}
catch (Throwable ex) {
this.writeCompletionBarrier.onError(ex);
return;
}
result.subscribe(this.writeCompletionBarrier);
}
else {
this.completed = true;

Loading…
Cancel
Save