From: Kai Moritz Date: Mon, 5 Sep 2022 16:52:40 +0000 (+0200) Subject: WIP X-Git-Tag: sumup-gateway--springified---lvm-2-tage~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=7e38c678f43c975f2a58391bb32e1d044278e237;p=demos%2Fkafka%2Ftraining WIP --- diff --git a/README.sh b/README.sh index 500eea2..b140be9 100755 --- a/README.sh +++ b/README.sh @@ -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 gateway-0 gateway-1 mvn clean install || exit else echo "Using image existing images:" @@ -30,14 +30,16 @@ docker-compose up -d gateway gateway-0 gateway-1 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 +echo 666 | http -v :8082/peter +echo 666 | http -v :8082/klaus +echo foo | http -v :8082/foo + 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 +echo 66 | http -v :8080/peter +echo 66 | http -v :8081/klaus docker-compose stop consumer docker-compose logs consumer diff --git a/docker-compose.yml b/docker-compose.yml index f4b271f..824a275 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,23 +73,23 @@ services: image: juplo/toolbox command: sleep infinity - gateway-partition-0: + gateway-0: image: juplo/sumup-gateway--springified:1.0-SNAPSHOT ports: - 8080:8080 environment: server.port: 8080 - spring-kafka.bootstrap-servers: kafka:9092 + spring.kafka.bootstrap-servers: kafka:9092 spring.kafka.client-id: gateway-0 sumup.gateway.partition: 0 - gateway-0: + gateway-1: image: juplo/sumup-gateway--springified:1.0-SNAPSHOT ports: - 8081:8080 environment: server.port: 8080 - spring-kafka.bootstrap-servers: kafka:9092 + spring.kafka.bootstrap-servers: kafka:9092 spring.kafka.client-id: gateway-1 sumup.gateway.partition: 1 @@ -99,7 +99,7 @@ services: - 8082:8080 environment: server.port: 8080 - spring-kafka.bootstrap-servers: kafka:9092 + spring.kafka.bootstrap-servers: kafka:9092 spring.kafka.client-id: gateway consumer: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index ed234c7..bdcb441 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,3 +1,6 @@ +sumup: + gateway: + topic: test management: endpoint: shutdown: @@ -18,7 +21,7 @@ info: group-id: ${spring.kafka.consumer.group-id} auto-offset-reset: ${spring.kafka.consumer.auto-offset-reset} auto-commit-interval-ms: ${spring.kafka.consumer.properties.auto.commit.interval.ms} - topic: ${spring.kafka.template.default-topic} + topic: ${sumup.gateway.topic} acks: ${spring.kafka.producer.acks} batch-size: ${spring.kafka.producer.batch-size} linger-ms: ${spring.kafka.producer.properties.linger.ms}