From f13914dd4810cd37df8380742a3033ba486eeb04 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 22 Nov 2022 23:43:14 +0100 Subject: [PATCH] =?utf8?q?Verbesserungen=20&=20Korrekturen=20aus=20simple-?= =?utf8?q?consumer=20=C3=BCbernommen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.sh | 18 +++++++++++++----- docker-compose.yml | 10 ++++++---- pom.xml | 6 +++++- src/main/resources/application.yml | 2 +- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/README.sh b/README.sh index c0a65f0..20c873e 100755 --- a/README.sh +++ b/README.sh @@ -4,14 +4,13 @@ IMAGE=juplo/spring-consumer-kafkalistener:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then - docker-compose down -v + docker-compose down -v --remove-orphans mvn clean exit fi -trap 'kill $(jobs -p) 2>/dev/null' EXIT - -docker-compose up -d kafka-0 kafka-1 kafka-2 kafka-3 cli +docker-compose up -d kafka-1 kafka-2 kafka-3 cli +docker-compose rm -svf consumer if [[ $(docker image ls -q $IMAGE) == "" || @@ -25,6 +24,15 @@ else fi docker-compose up setup +docker-compose up -d producer +docker-compose ps + docker-compose up -d consumer -docker-compose up producer +sleep 5 +docker-compose stop consumer + +docker-compose start consumer +sleep 5 + +docker-compose stop producer consumer docker-compose logs consumer diff --git a/docker-compose.yml b/docker-compose.yml index 9ed194b..ddef330 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,15 +101,17 @@ services: cli: image: juplo/toolbox command: sleep infinity + depends_on: + - kafka-1 + - kafka-2 + - kafka-3 producer: - image: juplo/supersimple-producer:1.0-SNAPSHOT - environment: - spring.kafka.bootstrap-servers: kafka:9092 + image: juplo/simple-producer:1.0-SNAPSHOT + command: kafka:9092 test producer consumer: image: juplo/spring-consumer-kafkalistener:1.0-SNAPSHOT environment: spring.kafka.bootstrap-servers: kafka:9092 spring.kafka.client-id: consumer - diff --git a/pom.xml b/pom.xml index e28ae92..b908802 100644 --- a/pom.xml +++ b/pom.xml @@ -13,9 +13,9 @@ de.juplo.kafka spring-consumer-kafkalistener - 1.0-SNAPSHOT Spring Consumer Super Simple Consumer-Group, that is implemented as Spring-Boot application and configured by Spring Kafka + 1.0-SNAPSHOT 11 @@ -61,6 +61,10 @@ + + pl.project13.maven + git-commit-id-plugin + org.springframework.boot spring-boot-maven-plugin diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 9ca7eb8..40f7310 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -31,6 +31,6 @@ logging: level: root: INFO de.juplo: DEBUG - org.springframework.kafka: DEBUG + org.springframework.kafka: INFO server: port: 8881 -- 2.20.1