X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=README.sh;h=05178a3403379e5f3615e298b1da19007e24095e;hb=40c2e597c8b695fe3d5e2675ce0c1a975b0065bd;hp=fe237dc2ee9c7af8bfb45472005c2bd5022dfbf6;hpb=d6285c99580cf17465182b68c68ae9a3674ae7a7;p=demos%2Fkafka%2Ftraining diff --git a/README.sh b/README.sh index fe237dc..05178a3 100755 --- a/README.sh +++ b/README.sh @@ -1,6 +1,6 @@ #!/bin/bash -IMAGE=juplo/endless-consumer:1.0-SNAPSHOT +IMAGE=juplo/sumup-adder:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then @@ -9,14 +9,15 @@ then exit fi -docker-compose up -d zookeeper kafka cli +docker-compose up -d zookeeper kafka-1 kafka-2 kafka-3 cli mongo express if [[ $(docker image ls -q $IMAGE) == "" || "$1" = "build" ]] then - mvn install || exit + docker-compose rm -svf adder + mvn clean install || exit else echo "Using image existing images:" docker image ls $IMAGE @@ -25,22 +26,21 @@ 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 gateway requests adder + +while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway..."; sleep 1; done +while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for requests..."; sleep 1; done +while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for adder..."; sleep 1; done + +docker-compose up -d peter ute franz beate klaus uschi + +http -v :8082/results +sleep 3 +http -v :8082/results + +docker-compose kill -s 9 adder + +docker-compose up -d adder +sleep 3 +docker-compose kill -s 9 peter ute franz beate klaus uschi +http -v :8082/results