X-Git-Url: http://juplo.de/gitweb/?a=blobdiff_plain;f=README.sh;h=e3acee009ecfe0b3275c8905fa3ef1926151af03;hb=e2d649ff5c692658232366ae0247d2acf3909c21;hp=72f0c60db69f3c6e97e357b8522f01f1615e9e19;hpb=a1e7b0e201440216ba91a94aac0f4f0b3ed3d143;p=demos%2Fkafka%2Ftraining diff --git a/README.sh b/README.sh index 72f0c60..e3acee0 100755 --- a/README.sh +++ b/README.sh @@ -1,6 +1,6 @@ #!/bin/bash -IMAGE=juplo/endless-consumer:1.0-SNAPSHOT +IMAGE=juplo/springified-endless-consumer:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then @@ -26,21 +26,26 @@ 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 consumer -sleep 5 +until [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for the producer..."; sleep 1; done +echo 'Hallo Welt!' | http -v :8080/peter +echo peter | http -v :8080/ +http -v PUT :8080/peter 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 +until [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for the consumer..."; sleep 1; done +sleep 5 +http -v :8081/seen http -v :8081/actuator/health -http -v post :8081/actuator/shutdown -docker-compose stop producer +docker-compose stop producer consumer docker-compose ps -docker-compose logs --tail=100 consumer +docker-compose logs consumer +docker-compose exec -T cli bash << 'EOF' +echo "Messages in topic \"test\":" +kafkacat -C -b kafka:9092 -t test -o 0 -e +echo "Messages in topic \"dlq\":" +kafkacat -C -b kafka:9092 -t dlq -o 0 -e +EOF