Verbesserungen & Korrekturen aus simple-consumer übernommen simple-consumer--spikzettel---lvm-2-tage--ease-path
authorKai Moritz <kai@juplo.de>
Tue, 22 Nov 2022 21:33:04 +0000 (22:33 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 22 Nov 2022 21:33:04 +0000 (22:33 +0100)
README.sh
docker-compose.yml

index 2ea1b38..74eb764 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -4,17 +4,16 @@ IMAGE=juplo/simple-consumer:1.0-SNAPSHOT
 
 if [ "$1" = "cleanup" ]
 then
-  docker-compose down -v
+  docker-compose down -v --remove-orphans
   exit
 fi
 
-docker-compose up -d kafka-0 kafka-1 kafka-2 kafka-3 cli
+docker-compose up -d kafka-1 kafka-2 kafka-3 cli
 docker-compose rm -svf consumer-1 consumer-2 consumer-3
 
-echo "Waiting for the Kafka-Cluster to become ready..."
-docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
 docker-compose up setup
 docker-compose up -d producer consumer-1 consumer-2 consumer-3
+docker-compose ps
 sleep 5
 
 docker-compose stop consumer-2 consumer-3
index 293db15..ce1076c 100644 (file)
@@ -34,6 +34,8 @@ services:
       KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
     ports:
       - 9081:9081
+    depends_on:
+      - kafka-0
 
   kafka-2:
     image: bitnami/kafka:3.3.1
@@ -58,6 +60,8 @@ services:
       default:
         aliases:
           - kafka
+    depends_on:
+      - kafka-0
 
   kafka-3:
     image: bitnami/kafka:3.3.1
@@ -77,6 +81,9 @@ services:
       KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
     ports:
       - 9083:9083
+    depends_on:
+      - kafka-0
+
 
   setup:
     image: juplo/toolbox
@@ -86,14 +93,22 @@ services:
         kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2 --replication-factor 3 --config min.insync.replicas=2
         kafka-topics --bootstrap-server kafka:9092 --describe --topic test
       "
+    depends_on:
+      - kafka-1
+      - kafka-2
+      - kafka-3
 
   cli:
     image: juplo/toolbox
     command: sleep infinity
+    depends_on:
+      - kafka-1
+      - kafka-2
+      - kafka-3
 
   producer:
     image: juplo/simple-producer:1.0-SNAPSHOT
-    command: producer
+    command: kafka:9092 test producer
 
   consumer-1:
     image: juplo/simple-consumer:1.0-SNAPSHOT