From: Kai Moritz Date: Sun, 3 Nov 2024 10:07:45 +0000 (+0100) Subject: Setup und `README.sh` zum Aufzeigen der Auswirkungen von `delivery.timeout.ms` X-Git-Tag: producer/spring-producer--auditheaders--2024-11-13--si~2 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=91a049763911220085963c3e2f44a5fc66d5d914;p=demos%2Fkafka%2Ftraining Setup und `README.sh` zum Aufzeigen der Auswirkungen von `delivery.timeout.ms` --- diff --git a/README.sh b/README.sh index 499780a..918e83a 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 producer +docker compose -f docker/docker-compose.yml rm -svf setup producer if [[ $(docker image ls -q $IMAGE) == "" || @@ -27,16 +27,17 @@ 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-1 consumer-2 -sleep 15 +sleep 5 + +docker compose -f docker/docker-compose.yml pause kafka-1 kafka-3 +sleep 20 +docker compose -f docker/docker-compose.yml unpause kafka-1 kafka-3 +sleep 3 docker compose -f docker/docker-compose.yml stop producer echo -echo "Von consumer-1 empfangen:" -docker compose -f docker/docker-compose.yml logs consumer-1 | grep '\ test\/.' -echo -echo "Von consumer-2 empfangen:" -docker compose -f docker/docker-compose.yml logs consumer-2 | grep '\ test\/.' +echo "Empfangen:" +docker compose -f docker/docker-compose.yml exec cli kafkacat -b kafka:9092 -t test -e -q -J -docker compose -f docker/docker-compose.yml stop consumer-1 consumer-2 +docker compose -f docker/docker-compose.yml logs producer | grep ERROR diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c417a7f..d66bb2a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -145,7 +145,7 @@ services: kafka-topics --bootstrap-server kafka:9092 \ --create \ --topic test \ - --partitions 2 \ + --partitions 1 \ --replication-factor 3 \ --config min.insync.replicas=2 \ && echo Das Topic \'test\' wurde erfolgreich angelegt: \ @@ -195,14 +195,12 @@ services: juplo.bootstrap-server: kafka:9092 juplo.client-id: producer juplo.producer.topic: test + juplo.producer.delivery-timeout: 2147483647ms + juplo.producer.buffer-memory: 32768 - consumer-1: + consumer: image: juplo/simple-consumer:1.0-SNAPSHOT - command: kafka:9092 test my-group consumer-1 - - consumer-2: - image: juplo/simple-consumer:1.0-SNAPSHOT - command: kafka:9092 test my-group consumer-2 + command: kafka:9092 test my-group consumer volumes: zookeeper-data: