X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=README.sh;h=6440022ebb05bcd5e24143f9b1f143a0f7b05123;hb=refs%2Fheads%2Fbugreport;hp=8a9f790788c53e0f1d8f6c130ae79af085588c6d;hpb=510d12cfdbfa4fac3914b271894d6db3451eb8ee;p=demos%2Fkafka%2Ftraining diff --git a/README.sh b/README.sh index 8a9f790..6440022 100755 --- a/README.sh +++ b/README.sh @@ -1,7 +1,5 @@ #!/bin/bash -IMAGE=juplo/rest-producer:1.0-SNAPSHOT - if [ "$1" = "cleanup" ] then docker-compose down -v @@ -10,60 +8,23 @@ fi docker-compose up -d zookeeper kafka-1 kafka-2 kafka-3 cli -if [[ - $(docker image ls -q $IMAGE) == "" || - "$1" = "build" -]] -then - mvn install || exit -else - echo "Using image existing images:" - docker image ls $IMAGE -fi - echo "Waiting for the Kafka-Cluster to become ready..." docker-compose exec cli cub kafka-ready -b kafka:9092 3 60 > /dev/null 2>&1 || exit 1 docker-compose up setup -docker-compose up -d -while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for acks-1..."; sleep 1; done -while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for acks-all..."; sleep 1; done +docker-compose up producer +docker-compose up consumer -kafkacat -L -b :9092 -docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test -# tag::foo[] -echo foo | http -v :8081/acks-1 -echo foo | http -v :8082/acks-all -kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n' -# end::foo[] -sleep 1 -kafkacat -L -b :9092 -docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test -kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n' - -# tag::stop[] docker-compose stop kafka-1 -kafkacat -L -b :9092 -# end::stop[] docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test -time echo bar | http -v :8081/acks-1 -time echo bar | http -v :8081/acks-1 -time echo bar | http -v :8082/acks-all -time echo bar | http -v :8082/acks-all -sleep 1 -kafkacat -L -b :9092 -docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test -kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n' +docker-compose up producer +docker-compose up consumer docker-compose stop kafka-3 -kafkacat -L -b :9092 docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test -time echo foobar | http -v :8081/acks-1 -time echo foobar | http -v :8081/acks-1 -time echo foobar | http -v :8082/acks-all -sleep 1 -kafkacat -L -b :9092 -docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test -kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n' +docker-compose up producer +docker-compose up consumer +docker-compose up consumer +docker-compose up consumer