From 5210c98a3ddff63edcfc7c97fb1076a95c1c9c0d Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 3 Mar 2024 10:08:36 +0100 Subject: [PATCH] FIX:delay_vs_delayElements --- src/test/java/de/juplo/kafka/chat/backend/TestWriter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 133a7689..0d2c41e7 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java @@ -42,10 +42,10 @@ public class TestWriter return i++; } }) + .delayElements(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500))) .map(i -> "Message #" + i) - .flatMap(message -> Mono - .delay(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500))) - .thenMany(sendMessage(chatRoom, message).retryWhen(Retry.fixedDelay(10, Duration.ofSeconds(1))))) + .flatMap(message -> sendMessage(chatRoom, message) + .retryWhen(Retry.fixedDelay(10, Duration.ofSeconds(1)))) .doOnNext(message -> { sentMessages.add(message); -- 2.20.1