From e724add93926173778443d4ce54e21f9916868ab Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 14 Jun 2023 23:17:24 +0200 Subject: [PATCH] =?utf8?q?Verbesserungen=20aus=20der=20alten=20acks-=C3=9C?= =?utf8?q?bung=20=C3=BCbernommen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.sh b/README.sh index 57506e6..3debc3e 100755 --- a/README.sh +++ b/README.sh @@ -21,12 +21,27 @@ while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait echo "Resetting the topic" docker-compose -f docker/docker-compose.yml restart setup +docker-compose -f docker/docker-compose.yml exec -T cli bash << 'EOF' +# tag::describe[] +kafka-topics --bootstrap-server kafka:9092 --describe --topic test +# end::describe[] +EOF + +# tag::foo[] echo -n Alle Broker laufen über acks-0 | http -v :8080/foo echo -n Alle Broker laufen über acks-1 | http -v :8081/foo echo -n Alle Broker laufen über acks-all | http -v :8082/foo +# end::foo[] +echo +echo "Reading all messages, that were really written:" +# tag::foo[] +kafkacat -b :9092 -t test -o 0 -f'key: %k\toffset: %o\tvalue: %s\n' -qe +# end::foo[] echo "Stopping kafka-1" docker-compose -f docker/docker-compose.yml stop kafka-1 +docker-compose -f docker/docker-compose.yml exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test +echo echo "Restarting acks-0 acks-1 acks-all" docker-compose -f docker/docker-compose.yml restart acks-0 acks-1 acks-all while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for acks-0..."; sleep 1; done @@ -36,9 +51,14 @@ while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait echo -n kafka-1 wurde beendet über acks-0 | http -v :8080/foo echo -n kafka-1 wurde beendet über acks-1 | http -v :8081/foo echo -n kafka-1 wurde beendet über acks-all | http -v :8082/foo +echo +echo "Reading all messages, that were really written:" +kafkacat -b :9092 -t test -o 0 -f'key: %k\toffset: %o\tvalue: %s\n' -qe echo "Stopping kafka-3" docker-compose -f docker/docker-compose.yml stop kafka-3 +docker-compose -f docker/docker-compose.yml exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test +echo echo "Restarting acks-0 acks-1 acks-all" docker-compose -f docker/docker-compose.yml restart acks-0 acks-1 acks-all while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for acks-0..."; sleep 1; done @@ -48,6 +68,6 @@ while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Wait echo -n kafka-1 und kafka-3 wurden beendet über acks-0 | http -v :8080/foo echo -n kafka-1 und kafka-3 wurden beendet über acks-1 | http -v :8081/foo echo -n kafka-1 und kafka-3 wurden beendet über acks-all | http -v :8082/foo - +echo echo "Reading all messages, that were really written:" kafkacat -b :9092 -t test -o 0 -f'key: %k\toffset: %o\tvalue: %s\n' -qe -- 2.20.1