X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=README.sh;h=d166ac3885e1cfa0e7e015eef43c60b0e414f120;hb=f83599b6aaefff62c286e2143bb2e8a81751e6fd;hp=fe237dc2ee9c7af8bfb45472005c2bd5022dfbf6;hpb=d6285c99580cf17465182b68c68ae9a3674ae7a7;p=demos%2Fkafka%2Ftraining diff --git a/README.sh b/README.sh index fe237dc..d166ac3 100755 --- a/README.sh +++ b/README.sh @@ -9,7 +9,7 @@ then exit fi -docker-compose up -d zookeeper kafka cli +docker-compose up -d zookeeper kafka cli mongo express if [[ $(docker image ls -q $IMAGE) == "" || @@ -25,22 +25,18 @@ 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 producer -docker-compose up consumer & -while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer..."; sleep 1; done -sleep 5 -docker-compose exec -T cli bash << 'EOF' -echo "Writing poison pill into topic test..." -# tag::poisonpill[] -echo 'BOOM!' | kafkacat -P -b kafka:9092 -t test -# end::poisonpill[] -EOF -while [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Consumer is still running..."; sleep 1; done -http -v :8081/actuator/health -echo "Restarting consumer" -http -v post :8081/start -while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer..."; sleep 1; done -while [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Consumer is still running..."; sleep 1; done -http -v :8081/actuator/health -http -v post :8081/actuator/shutdown -docker-compose stop producer +docker-compose up -d + +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 + +sleep 10 + +docker-compose stop bart nerd riddler kraut poet linux + +http -v :8081/seen +http -v :8081/seen/bart +http -v :8082/seen +http -v :8082/seen/bart + +docker-compose stop consumer-1 consumer-2