Setup mit 3 Konsumern und ein bischen mehr Dampf (`README.sh` angepasst)
authorKai Moritz <kai@juplo.de>
Sat, 2 Nov 2024 17:38:18 +0000 (18:38 +0100)
committerKai Moritz <kai@juplo.de>
Sun, 10 Nov 2024 13:27:48 +0000 (14:27 +0100)
README.sh
docker/docker-compose.yml

index cf72e51..07f7de4 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -10,7 +10,7 @@ then
 fi
 
 docker compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3
-docker compose -f docker/docker-compose.yml rm -svf consumer
+docker compose -f docker/docker-compose.yml rm -svf consumer-1
 
 if [[
   $(docker image ls -q $IMAGE) == "" ||
@@ -27,13 +27,9 @@ docker compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1
 
 
 docker compose -f docker/docker-compose.yml up -d producer
-docker compose -f docker/docker-compose.yml up -d consumer
+docker compose -f docker/docker-compose.yml up -d consumer-1
 
-sleep 5
-docker compose -f docker/docker-compose.yml stop consumer
+sleep 10
+docker compose -f docker/docker-compose.yml exec cli http consumer-1:8881/
 
-docker compose -f docker/docker-compose.yml start consumer
-sleep 5
-
-docker compose -f docker/docker-compose.yml stop producer consumer
-docker compose -f docker/docker-compose.yml logs consumer
+docker compose -f docker/docker-compose.yml stop producer consumer-1
index 4603a26..db8abf6 100644 (file)
@@ -215,14 +215,34 @@ services:
       juplo.client-id: producer
       juplo.producer.topic: test
       juplo.producer.linger-ms: 666
-      juplo.producer.throttle-ms: 100
+      juplo.producer.throttle-ms: 10
 
-  consumer:
+  consumer-1:
     image: juplo/spring-consumer:1.1-log-compaction-SNAPSHOT
     environment:
       juplo.bootstrap-server: kafka:9092
-      juplo.client-id: consumer
+      juplo.client-id: consumer-1
       juplo.consumer.topic: test
+      juplo.producer.linger-ms: 1000
+      logging.level.de.juplo: TRACE
+
+  consumer-2:
+    image: juplo/spring-consumer:1.1-log-compaction-SNAPSHOT
+    environment:
+      juplo.bootstrap-server: kafka:9092
+      juplo.client-id: consumer-2
+      juplo.consumer.topic: test
+      juplo.producer.linger-ms: 1000
+      logging.level.de.juplo: TRACE
+
+  consumer-3:
+    image: juplo/spring-consumer:1.1-log-compaction-SNAPSHOT
+    environment:
+      juplo.bootstrap-server: kafka:9092
+      juplo.client-id: consumer-3
+      juplo.consumer.topic: test
+      juplo.producer.linger-ms: 1000
+      logging.level.de.juplo: TRACE
 
 volumes:
   zookeeper-data: