Alles bis auf das Setup und README.sh für die Vorführung gelöscht
[demos/kafka/training] / README.sh
1 #!/bin/bash
2
3 if [ "$1" = "cleanup" ]
4 then
5   docker-compose down -v
6   exit
7 fi
8
9 docker-compose up -d
10 docker-compose logs -f setup
11
12 while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
13 while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer-1..."; sleep 1; done
14 while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for consumer-2..."; sleep 1; done
15
16 echo 6  | http -v :8080/peter
17 echo 77 | http -v :8080/klaus
18
19 echo "Writing poison pill..."
20 echo 'BOOM!' | kafkacat -P -b :9092 -t test
21
22 docker-compose logs -f consumer-1 consumer-2
23
24 echo "Restarting consumer-1..."
25 docker-compose up consumer-1