Update EventBusFlux.java

This commit is contained in:
Andrea Cavalli 2021-01-23 11:00:41 +01:00
parent d093b680f8
commit 8137067edf

View File

@ -98,7 +98,9 @@ public class EventBusFlux {
.flatMap(item -> Mono.<Message<T>>create(itemSink -> { .flatMap(item -> Mono.<Message<T>>create(itemSink -> {
var responseHandler = MonoUtils.toHandler(itemSink); var responseHandler = MonoUtils.toHandler(itemSink);
eventBus.request(subscriptionAddress + ".signal", SignalMessage.<T>onNext(item), signalDeliveryOptions, responseHandler); eventBus.request(subscriptionAddress + ".signal", SignalMessage.<T>onNext(item), signalDeliveryOptions, responseHandler);
})).subscribe(response -> {}, error -> { }))
.subscribeOn(Schedulers.single())
.subscribe(response -> {}, error -> {
if (error instanceof ReplyException) { if (error instanceof ReplyException) {
var errorMessageCode = ((ReplyException) error).failureCode(); var errorMessageCode = ((ReplyException) error).failureCode();
// -1 == NO_HANDLERS // -1 == NO_HANDLERS
@ -309,7 +311,9 @@ public class EventBusFlux {
} }
} }
}))) })))
.subscribeOn(Schedulers.single()) .subscribeOn(Schedulers.boundedElastic())
.onBackpressureBuffer()
.publishOn(Schedulers.single())
.subscribe(v -> {}, emitter::error); .subscribe(v -> {}, emitter::error);
emitter.onDispose(() -> { emitter.onDispose(() -> {