From 3ed5fd98c783a10a888630d6ce7117f9f1f8ce65 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 2 Mar 2024 18:21:05 +0100 Subject: [PATCH] FIX:take_vs_limitRate --- src/test/java/de/juplo/kafka/chat/backend/TestListener.java | 5 ++--- src/test/java/de/juplo/kafka/chat/backend/TestWriter.java | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) 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) -- 2.20.1