Fix new Sonar smell

* Make `adaptPollableChannelToPublisher()` as non-blocking
This commit is contained in:
Artem Bilan
2020-02-13 14:11:21 -05:00
parent 89e31b2a21
commit 8c4675aa83

View File

@@ -73,9 +73,9 @@ public final class MessageChannelReactiveUtils {
@SuppressWarnings("unchecked")
private static <T> Publisher<Message<T>> adaptPollableChannelToPublisher(PollableChannel inputChannel) {
return Mono.fromCallable(() -> (Message<T>) inputChannel.receive())
return Mono.fromCallable(() -> (Message<T>) inputChannel.receive(0))
.subscribeOn(Schedulers.boundedElastic())
.repeatWhenEmpty(it -> it.delayElements(Duration.ofMillis(10)))
.repeatWhenEmpty(it -> it.delayElements(Duration.ofMillis(100))) // NOSONAR - magic
.repeat();
}