From: Kai Moritz Date: Sat, 2 Mar 2024 17:21:05 +0000 (+0100) Subject: FIX:take_vs_limitRate X-Git-Tag: rebase--2024-03-03--11-38~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=3ed5fd98c783a10a888630d6ce7117f9f1f8ce65;p=demos%2Fkafka%2Fchat FIX:take_vs_limitRate --- diff --git a/src/test/java/de/juplo/kafka/chat/backend/TestListener.java b/src/test/java/de/juplo/kafka/chat/backend/TestListener.java index e413c52d..35f65acd 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestListener.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestListener.java @@ -51,10 +51,9 @@ public class TestListener "Received a message from chat-room {}: {}", chatRoom.getName(), message); - }) - .take(10); + }); }) - .take(100) + .limitRate(10) .takeUntil(message -> !running) .doOnComplete(() -> log.info("TestListener is done")) .parallel(chatRooms.length) 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 8f7bc816..61516b0d 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestWriter.java @@ -63,6 +63,7 @@ public class TestWriter user, e.getResponseBodyAsString(Charset.defaultCharset())); }) + .limitRate(1) .takeUntil(message -> !running) .doOnComplete(() -> log.info("TestWriter {} is done", user)) .parallel(1)