From: Kai Moritz Date: Sun, 29 Jan 2023 16:05:22 +0000 (+0100) Subject: Tags für die Übung ergänzt X-Git-Tag: rest-producer--partitioning X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=061fcde1c8d74912149dfbbd7b19d311d9f29718;p=demos%2Fkafka%2Ftraining Tags für die Übung ergänzt --- diff --git a/README.sh b/README.sh index b0b9604..76ed9c3 100755 --- a/README.sh +++ b/README.sh @@ -29,8 +29,10 @@ while ! [[ $(http 0:8000/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait while ! [[ $(http 0:8001/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer-1..."; sleep 1; done docker-compose up -d consumer +# tag::http[] echo -n Nachricht 1 an Producer 0 | http -v :8000/foo echo -n Nachricht 1 an Producer 1 | http -v :8001/foo +# end::http[] echo -n Nachricht 2 an Producer 0 | http -v :8000/bar echo -n Nachricht 2 an Producer 1 | http -v :8001/bar @@ -39,8 +41,9 @@ docker-compose logs consumer docker-compose exec -T cli bash << 'EOF' echo "Altering number of partitions from 3 to 7..." kafka-topics --bootstrap-server kafka:9092 --describe --topic test -kafka-topics --bootstrap-server kafka:9092 --describe --topic test +# tag::repartitioning[] kafka-topics --bootstrap-server kafka:9092 --alter --topic test --partitions 7 +# end::repartitioning[] kafka-topics --bootstrap-server kafka:9092 --describe --topic test EOF @@ -55,5 +58,7 @@ echo -n Nachricht 4 an Producer 1 | http -v :8001/bar docker-compose logs consumer +# tag::kafkacat[] kafkacat -b :9092 -t test -o 0 -p0 -f'p=%p|o=%o|k=%k|v=%s\n' -qe kafkacat -b :9092 -t test -o 0 -p1 -f'p=%p|o=%o|k=%k|v=%s\n' -qe +# end::kafkacat[]