Fix new Sonar smell
* Make `adaptPollableChannelToPublisher()` as non-blocking
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user