Fix ReactiveStreamsConsumer for PollableChannel
https://build.spring.io/browse/INT-MASTERSPRING40-985/ * Move `onSubscribe()` callback to the `subscribe()` operator to honor a `request` contract from the target subscriber
This commit is contained in:
@@ -172,16 +172,17 @@ public class ReactiveStreamsConsumer extends AbstractEndpoint implements Integra
|
||||
else if (this.subscriber != null) {
|
||||
this.subscription =
|
||||
Flux.from(this.publisher)
|
||||
.doOnComplete(this.subscriber::onComplete)
|
||||
.doOnSubscribe(this.subscriber::onSubscribe)
|
||||
.subscribe((data) -> {
|
||||
try {
|
||||
this.subscriber.onNext(data);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
this.errorHandler.handleError(ex);
|
||||
}
|
||||
});
|
||||
try {
|
||||
this.subscriber.onNext(data);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
this.errorHandler.handleError(ex);
|
||||
}
|
||||
},
|
||||
null,
|
||||
this.subscriber::onComplete,
|
||||
this.subscriber::onSubscribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user