From 8e7f74bc7727cbfc33165e05258c9e231c7a0099 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 18 Nov 2022 17:17:42 +0100 Subject: [PATCH] =?utf8?q?Das=20README.sh=20f=C3=BChrt=20die=20Reaktion=20?= =?utf8?q?auf=20eine=20Poison=20Pill=20vor?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * Das vorgeführte Verhalten entspricht der Übung "Poison Pill" * Bis auf die Build-Spezifika entspricht die `README.sh` der aus der Vorlage `spring-consumer--fehlerbehandlung`. --- README.sh | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/README.sh b/README.sh index feaa66a..c2ea029 100755 --- a/README.sh +++ b/README.sh @@ -9,8 +9,6 @@ then exit fi -trap 'kill $(jobs -p) 2>/dev/null' EXIT - docker-compose up -d kafka-0 kafka-1 kafka-2 kafka-3 cli if [[ @@ -25,19 +23,26 @@ else docker image ls $IMAGE fi -docker-compose up setup -docker-compose up -d producer consumer-1 consumer-2 +docker-compose up -d +docker-compose logs -f setup while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer-1..."; sleep 1; done while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer-2..."; sleep 1; done +# tag::nachrichten[] echo 6 | http -v :8080/peter echo 77 | http -v :8080/klaus -echo 66 | http -v :8080/peter -echo 7 | http -v :8080/klaus +# end::nachrichten[] + +echo "Writing poison pill..." +# tag::poisonpill[] +echo 'BOOM!' | kafkacat -P -b :9092 -t test +# end::poisonpill[] -docker-compose stop consumer-1 consumer-2 +docker-compose logs -f consumer-1 consumer-2 -docker-compose logs consumer-1 -docker-compose logs consumer-2 +echo "Restarting consumer-1..." +# tag::restart[] +docker-compose up consumer-1 +# end::restart[] -- 2.20.1