Skip to content

Commit 8c4675a

Browse files
committed
Fix new Sonar smell
* Make `adaptPollableChannelToPublisher()` as non-blocking
1 parent 89e31b2 commit 8c4675a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannelReactiveUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ private static <T> Publisher<Message<T>> adaptSubscribableChannelToPublisher(Sub
7373

7474
@SuppressWarnings("unchecked")
7575
private static <T> Publisher<Message<T>> adaptPollableChannelToPublisher(PollableChannel inputChannel) {
76-
return Mono.fromCallable(() -> (Message<T>) inputChannel.receive())
76+
return Mono.fromCallable(() -> (Message<T>) inputChannel.receive(0))
7777
.subscribeOn(Schedulers.boundedElastic())
78-
.repeatWhenEmpty(it -> it.delayElements(Duration.ofMillis(10)))
78+
.repeatWhenEmpty(it -> it.delayElements(Duration.ofMillis(100))) // NOSONAR - magic
7979
.repeat();
8080
}
8181

0 commit comments

Comments
 (0)