#!/bin/bash
-IMAGE=juplo/sumup-gateway:1.0-SNAPSHOT
+IMAGE=juplo/sumup-gateway--springified:1.0-SNAPSHOT
if [ "$1" = "cleanup" ]
then
"$1" = "build"
]]
then
- docker-compose rm -svf gateway
+ docker-compose rm -svf gateway gateway-0 gateway-1
mvn clean install || exit
else
echo "Using image existing images:"
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
while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for gateway..."; sleep 1; done
docker-compose up -d consumer
-echo foo | http -v :8080/bar
-echo 66 | http -v :8080/foo
+echo foo | http -v :8082/peter
+echo bar | http -v :8082/klaus
+
+echo FOO | http -v :8080/peter
+echo BAR | http -v :8081/klaus
-docker-compose logs gateway
docker-compose stop consumer
docker-compose logs consumer
command: sleep infinity
gateway-partition-0:
- image: juplo/sumup-gateway-springified:1.0-SNAPSHOT
+ image: juplo/sumup-gateway--springified:1.0-SNAPSHOT
ports:
- 8080:8080
environment:
server.port: 8080
spring-kafka.bootstrap-servers: kafka:9092
- spring.kafka.client-id: gateway-partition-0
+ spring.kafka.client-id: gateway-0
sumup.gateway.partition: 0
- gateway-partition-0:
- image: juplo/sumup-gateway-springified:1.0-SNAPSHOT
+ gateway-0:
+ image: juplo/sumup-gateway--springified:1.0-SNAPSHOT
ports:
- 8081:8080
environment:
server.port: 8080
spring-kafka.bootstrap-servers: kafka:9092
- spring.kafka.client-id: gateway-partition-1
+ spring.kafka.client-id: gateway-1
sumup.gateway.partition: 1
- gateway-hashed:
- image: juplo/sumup-gateway-springified:1.0-SNAPSHOT
+ gateway:
+ image: juplo/sumup-gateway--springified:1.0-SNAPSHOT
ports:
- 8082:8080
environment:
server.port: 8080
spring-kafka.bootstrap-servers: kafka:9092
- spring.kafka.client-id: gateway-hashed
+ spring.kafka.client-id: gateway
consumer:
image: juplo/toolbox
</parent>
<groupId>de.juplo.kafka</groupId>
- <artifactId>sumup-gateway</artifactId>
+ <artifactId>sumup-gateway--springified</artifactId>
<name>REST Gateway for the SumUp-Services</name>
- <description>A simple REST-Gateway to talk to the Sumup-Services</description>
+ <description>A simple REST-Gateway to talk to the Sumup-Services. This is the springified version!</description>
<version>1.0-SNAPSHOT</version>
<dependencies>