From: Kai Moritz Date: Sun, 3 Mar 2024 10:21:06 +0000 (+0100) Subject: DIRTYFIX:subscribe X-Git-Tag: rebase--2024-03-03--11-38 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=761c2632313046a87f6046409f956a6dc98896ef;p=demos%2Fkafka%2Fchat DIRTYFIX:subscribe --- 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 f01e9b57..b7a5b850 100644 --- a/src/test/java/de/juplo/kafka/chat/backend/TestListener.java +++ b/src/test/java/de/juplo/kafka/chat/backend/TestListener.java @@ -12,7 +12,6 @@ import org.springframework.http.codec.ServerSentEvent; import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import reactor.core.scheduler.Schedulers; import java.util.*; @@ -43,18 +42,8 @@ public class TestListener { return Mono.error(e); } - }) - .doOnNext(message -> - { - list.add(message); - log.info( - "Received a message from chat-room {}: {}", - chatRoom.getName(), - message); }); - }) - .takeUntil(message -> !running) - .doOnComplete(() -> log.info("TestListener is done")); + }); } Flux> receiveMessages(ChatRoomInfoTo chatRoom) @@ -76,8 +65,6 @@ public class TestListener final Map> receivedMessages = new HashMap<>(); - volatile boolean running = true; - TestListener(Integer port, ChatRoomInfoTo[] chatRooms) {