From: Kai Moritz Date: Fri, 1 Mar 2024 18:56:54 +0000 (+0100) Subject: WIP:test: HandoverIT-POC - Refactored listening into class `TestListener` X-Git-Tag: rebase--2024-03-03--11-38~11 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=09995381a4d5667cebd9d5dfdb915dcd48f169b5;p=demos%2Fkafka%2Fchat WIP:test: HandoverIT-POC - Refactored listening into class `TestListener` --- 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 0ea86287..1c993c17 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestListener.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestListener.java @@ -44,9 +44,14 @@ public class TestListener implements Runnable return Mono.error(e); } }) + .doOnNext(message -> log.info( + "Received a message from chat-room {}: {}", + chatRoom, + message)) .take(30)) .takeUntil(message -> !running) - .subscribe(message -> log.info("Received message: {}", message)); + .then() + .block(); } Flux> receiveMessages(ChatRoomInfoTo chatRoom)