Setup & Vorführskript verbessert und Tags für Übung ergänzt rest-producer rest-producer---lvm-2-tage--easy-path
authorKai Moritz <kai@juplo.de>
Tue, 22 Nov 2022 20:48:57 +0000 (21:48 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 6 Dec 2022 19:02:24 +0000 (20:02 +0100)
README.sh
docker-compose.yml

index 9b15a70..3dc3476 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -29,10 +29,15 @@ docker-compose up -d producer
 
 while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
 
-# tag::http[]
-echo -n bar | http -v :8080/foo
-echo -n foo | http -v :8080/bar X-id:666
-# end::http[]
-# tag::kafkacat[]
-docker-compose exec cli kafkacat -b kafka:9092 -t test -f "%p|%o|%k=%s|%h\n" -e
-# end::kafkacat[]
+# tag::success[]
+echo -n 'Hallo Welt!' | http -v :8080/foo
+# end::success[]
+
+# tag::failure[]
+dd if=/dev/zero bs=1024 count=1024  | http -v :8080/bar
+# end::failure[]
+
+# tag::timeout[]
+docker-compose stop kafka-1 kafka-2 kafka-3
+echo -n 'Hallo again...' | http -v --timeout 30 :8080/foo
+# end::timeout[]
index 47775e3..195ffad 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,10 +93,18 @@ 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/rest-producer:1.0-SNAPSHOT
@@ -101,46 +116,6 @@ services:
       producer.client-id: producer
       producer.topic: test
 
-  peter:
-    image: juplo/rest-client:1.0-SNAPSHOT
-    environment:
-      server.port: 8080
-      rest-client.baseUrl: http://producer:8080
-      rest-client.username: peter
-      rest-client.throttle-ms: 1000
-
-  klaus:
-    image: juplo/rest-client:1.0-SNAPSHOT
-    environment:
-      server.port: 8080
-      rest-client.baseUrl: http://producer:8080
-      rest-client.username: klaus
-      rest-client.throttle-ms: 1100
-
-  beate:
-    image: juplo/rest-client:1.0-SNAPSHOT
-    environment:
-      server.port: 8080
-      rest-client.baseUrl: http://producer:8080
-      rest-client.username: beate
-      rest-client.throttle-ms: 900
-
-  franz:
-    image: juplo/rest-client:1.0-SNAPSHOT
-    environment:
-      server.port: 8080
-      rest-client.baseUrl: http://producer:8080
-      rest-client.username: franz
-      rest-client.throttle-ms: 800
-
-  uschi:
-    image: juplo/rest-client:1.0-SNAPSHOT
-    environment:
-      server.port: 8080
-      rest-client.baseUrl: http://producer:8080
-      rest-client.username: uschi
-      rest-client.throttle-ms: 1200
-
   consumer:
-    image: juplo/toolbox
-    command: kafkacat -C -b kafka:9092 -t test -o 0 -f'p=%p|o=%o|k=%k|v=%s\n'
+    image: juplo/simple-consumer:1.0-SNAPSHOT
+    command: kafka:9092 test my-group consumer