From: Kai Moritz Date: Wed, 14 Jun 2023 21:58:05 +0000 (+0200) Subject: Setup für die Spickzettel-Übung X-Git-Tag: consumer/simple-consumer--spickzettel---2023-10-signal~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=6b08cac8b4865b6c2e75097e6de61d22df1ed64a;p=demos%2Fkafka%2Ftraining Setup für die Spickzettel-Übung --- diff --git a/README.sh b/README.sh index 7d6406d..a3ccf09 100755 --- a/README.sh +++ b/README.sh @@ -9,24 +9,7 @@ fi docker-compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1 docker-compose -f docker/docker-compose.yml ps -docker-compose -f docker/docker-compose.yml up -t0 -d cli -sleep 1 -docker-compose -f docker/docker-compose.yml logs setup +docker-compose -f docker/docker-compose.yml up -t0 -d -echo -echo "Hilfe-Ausgabe von kafkacat" -echo -docker-compose -f docker/docker-compose.yml exec -T cli kafkacat -h -echo -echo "Nachrichten schreiben mit kafkacat" -echo -docker-compose -f docker/docker-compose.yml exec -T cli kafkacat -P -b kafka:9092 -t test << EOF -Hallo Welt! -Nachricht #1 -Nachricht #2 -Nachricht #3 -EOF -echo -echo "Nachrichten lesen mit kafkacat" -echo -docker-compose -f docker/docker-compose.yml exec cli kafkacat -C -b kafka:9092 -t test -o beginning -e +echo Run: +echo docker-compose -f docker/docker-compose.yml logs -t -f spikzettel consumer-1 consumer-2 consumer-3 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 875e209..0e3e0eb 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -211,6 +211,32 @@ services: - kafka-2 - kafka-3 + producer: + image: juplo/simple-producer:1.0-SNAPSHOT + command: kafka:9092 test producer + + consumer-1: + image: juplo/simple-consumer:1.0-SNAPSHOT + command: kafka:9092 test my-group consumer-1 + + consumer-2: + image: juplo/simple-consumer:1.0-SNAPSHOT + command: kafka:9092 test my-group consumer-2 + + consumer-3: + image: juplo/simple-consumer:1.0-SNAPSHOT + command: kafka:9092 test my-group consumer-3 + + spickzettel: + image: juplo/toolbox + command: > + bash -c ' + kafka-console-consumer \ + --bootstrap-server kafka:9092 \ + --topic __consumer_offsets --from-beginning \ + --formatter "kafka.coordinator.group.GroupMetadataManager\$$OffsetsMessageFormatter" + ' + volumes: zookeeper-data: zookeeper-log: