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 gateway gateway-0 gateway-1
+docker-compose up -d gateway gateway-0 gateway-1 consumer
-while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway..."; sleep 1; done
-
-docker-compose up -d consumer
+while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway..."; sleep 1; done
echo foo | http -v :8082/peter
echo bar | http -v :8082/klaus
+while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway-0..."; sleep 1; done
+while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway-1..."; sleep 1; done
+
echo FOO | http -v :8080/peter
echo BAR | http -v :8081/klaus