From fdede672f895f050ae40e036d767894631f66f7e Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 2 Nov 2024 18:38:18 +0100 Subject: [PATCH] Setup mit 3 Konsumern und ein bischen mehr Dampf (`README.sh` angepasst) --- README.sh | 14 +++++--------- docker/docker-compose.yml | 26 +++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/README.sh b/README.sh index cf72e51..07f7de4 100755 --- a/README.sh +++ b/README.sh @@ -10,7 +10,7 @@ then fi docker compose -f docker/docker-compose.yml up -d --remove-orphans kafka-1 kafka-2 kafka-3 -docker compose -f docker/docker-compose.yml rm -svf consumer +docker compose -f docker/docker-compose.yml rm -svf consumer-1 if [[ $(docker image ls -q $IMAGE) == "" || @@ -27,13 +27,9 @@ docker compose -f docker/docker-compose.yml up --remove-orphans setup || exit 1 docker compose -f docker/docker-compose.yml up -d producer -docker compose -f docker/docker-compose.yml up -d consumer +docker compose -f docker/docker-compose.yml up -d consumer-1 -sleep 5 -docker compose -f docker/docker-compose.yml stop consumer +sleep 10 +docker compose -f docker/docker-compose.yml exec cli http consumer-1:8881/ -docker compose -f docker/docker-compose.yml start consumer -sleep 5 - -docker compose -f docker/docker-compose.yml stop producer consumer -docker compose -f docker/docker-compose.yml logs consumer +docker compose -f docker/docker-compose.yml stop producer consumer-1 diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 4603a26..db8abf6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -215,14 +215,34 @@ services: juplo.client-id: producer juplo.producer.topic: test juplo.producer.linger-ms: 666 - juplo.producer.throttle-ms: 100 + juplo.producer.throttle-ms: 10 - consumer: + consumer-1: image: juplo/spring-consumer:1.1-log-compaction-SNAPSHOT environment: juplo.bootstrap-server: kafka:9092 - juplo.client-id: consumer + juplo.client-id: consumer-1 juplo.consumer.topic: test + juplo.producer.linger-ms: 1000 + logging.level.de.juplo: TRACE + + consumer-2: + image: juplo/spring-consumer:1.1-log-compaction-SNAPSHOT + environment: + juplo.bootstrap-server: kafka:9092 + juplo.client-id: consumer-2 + juplo.consumer.topic: test + juplo.producer.linger-ms: 1000 + logging.level.de.juplo: TRACE + + consumer-3: + image: juplo/spring-consumer:1.1-log-compaction-SNAPSHOT + environment: + juplo.bootstrap-server: kafka:9092 + juplo.client-id: consumer-3 + juplo.consumer.topic: test + juplo.producer.linger-ms: 1000 + logging.level.de.juplo: TRACE volumes: zookeeper-data: -- 2.20.1