From: Kai Moritz Date: Sat, 24 Sep 2022 13:10:27 +0000 (+0200) Subject: Compose-Setup überarbeitet: Grundlage für Übung `simple-consumer-scaling` X-Git-Tag: rest-producer---lvm-2-tage X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=1cd2d60f29b44574a2b6ca99cb7eeafa78cb4c90;p=demos%2Fkafka%2Ftraining Compose-Setup überarbeitet: Grundlage für Übung `simple-consumer-scaling` --- diff --git a/README.sh b/README.sh index 573aba8..3c098a7 100755 --- a/README.sh +++ b/README.sh @@ -26,7 +26,7 @@ fi 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 +docker-compose up -d producer consumer-1 while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done @@ -60,4 +60,4 @@ echo foofoo | http -v :8080/bar echo barbar | http -v :8080/foo docker-compose logs producer -docker-compose logs consumer +docker-compose logs consumer-1 diff --git a/docker-compose.yml b/docker-compose.yml index 7ae8d9b..78ca5dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -83,6 +83,46 @@ services: producer.client-id: producer producer.topic: test - consumer: + peter: image: juplo/toolbox - command: kafkacat -C -b kafka:9092 -t test -o 0 -f'p=%p|o=%o|k=%k|v=%s\n' + command: > + bash -c " + while [[ true ]]; + do + echo foo | http -v producer:8080/peter; + sleep 1; + done + " + + klaus: + image: juplo/toolbox + command: > + bash -c " + while [[ true ]]; + do + echo bar | http -v producer:8080/klaus; + sleep 1; + done + " + + consumer-1: + image: juplo/simple-consumer:1.0-SNAPSHOT + command: consumer-1 + + consumer-2: + image: juplo/simple-consumer:1.0-SNAPSHOT + command: consumer-2 + + consumer-3: + image: juplo/simple-consumer:1.0-SNAPSHOT + command: consumer-3 + + spikzettel: + image: juplo/toolbox + command: > + bash -c ' + kafka-console-consumer \ + --bootstrap-server kafka:9092 \ + --topic __consumer_offsets --from-beginning \ + --formatter "kafka.coordinator.group.GroupMetadataManager\$$OffsetsMessageFormatter" + '