exit
fi
-trap 'kill $(jobs -p) 2>/dev/null' EXIT
-
docker-compose up -d kafka-0 kafka-1 kafka-2 kafka-3 cli
if [[
docker image ls $IMAGE
fi
-docker-compose up setup
-docker-compose up -d producer consumer-1 consumer-2
+docker-compose up -d
+docker-compose logs -f setup
while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
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
+# tag::nachrichten[]
echo 6 | http -v :8080/peter
echo 77 | http -v :8080/klaus
-echo 66 | http -v :8080/peter
-echo 7 | http -v :8080/klaus
+# end::nachrichten[]
+
+echo "Writing poison pill..."
+# tag::poisonpill[]
+echo 'BOOM!' | kafkacat -P -b :9092 -t test
+# end::poisonpill[]
-docker-compose stop consumer-1 consumer-2
+docker-compose logs -f consumer-1 consumer-2
-docker-compose logs consumer-1
-docker-compose logs consumer-2
+echo "Restarting consumer-1..."
+# tag::restart[]
+docker-compose up consumer-1
+# end::restart[]