WIP:refactor: Refined channel-states, introduced `ChannelState` -- ALIGN
[demos/kafka/chat] / src / test / java / de / juplo / kafka / chat / backend / TestWriter.java
index 61516b0..c21acda 100644 (file)
@@ -42,10 +42,10 @@ public class TestWriter
             return i++;
           }
         })
+        .delayElements(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500)))
         .map(i -> "Message #" + i)
         .flatMap(message -> sendMessage(chatRoom, message)
-            .delayElement(Duration.ofMillis(ThreadLocalRandom.current().nextLong(500, 1500)))
-            .retryWhen(Retry.fixedDelay(10, Duration.ofSeconds(1))))
+            .retryWhen(Retry.backoff(10, Duration.ofSeconds(1))))
         .doOnNext(message ->
         {
           sentMessages.add(message);
@@ -100,8 +100,8 @@ public class TestWriter
 
 
   private final WebClient webClient;
-  private final ChatRoomInfoTo chatRoom;
 
+  final ChatRoomInfoTo chatRoom;
   final User user;
   final List<MessageTo> sentMessages = new LinkedList<>();