Implementierung vereinfacht & an Spring-Beispiele angepasst
[demos/kafka/training] / README.sh
index 25b8f62..b140be9 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-IMAGE=juplo/sumup-gateway:1.0-SNAPSHOT
+IMAGE=juplo/sumup-gateway--springified:1.0-SNAPSHOT
 
 if [ "$1" = "cleanup" ]
 then
@@ -10,13 +10,13 @@ then
 fi
 
 docker-compose up -d zookeeper kafka-1 kafka-2 kafka-3 cli
+docker-compose rm -svf gateway gateway-0 gateway-1
 
 if [[
   $(docker image ls -q $IMAGE) == "" ||
   "$1" = "build"
 ]]
 then
-  docker-compose rm -svf gateway
   mvn clean install || exit
 else
   echo "Using image existing images:"
@@ -26,15 +26,20 @@ 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 gateway
+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
+while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway..."; sleep 1; done
 
-docker-compose up -d consumer
+echo 666 | http -v :8082/peter
+echo 666 | http -v :8082/klaus
+echo foo | http -v :8082/foo
 
-echo foo | http -v :8080/bar
-echo 66  | http -v :8080/foo
 
-docker-compose logs gateway
+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 66 | http -v :8080/peter
+echo 66 | http -v :8081/klaus
+
 docker-compose stop consumer
 docker-compose logs consumer