From: Kai Moritz Date: Sat, 2 Mar 2024 17:21:44 +0000 (+0100) Subject: FIX:delayElement_vs_delay X-Git-Tag: rebase--2024-03-03--11-38~3 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=42958357aa8b5e39a8ffb2f3cfd8180c8451808c;p=demos%2Fkafka%2Fchat FIX:delayElement_vs_delay --- diff --git a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java index 61516b0d..133a7689 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java @@ -43,9 +43,9 @@ public class TestWriter } }) .map(i -> "Message #" + i) - .flatMap(message -> sendMessage(chatRoom, message) - .delayElement(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500))) - .retryWhen(Retry.fixedDelay(10, Duration.ofSeconds(1)))) + .flatMap(message -> Mono + .delay(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500))) + .thenMany(sendMessage(chatRoom, message).retryWhen(Retry.fixedDelay(10, Duration.ofSeconds(1))))) .doOnNext(message -> { sentMessages.add(message);