From 06b366bc4a98699288b6e890cc257b1fed4797ef Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 24 Sep 2022 14:46:01 +0200 Subject: [PATCH] =?utf8?q?Vorf=C3=BChrung=20der=20=C3=9Cbung=20verwendet?= =?utf8?q?=20den=20`simple-producer`?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- README.sh | 21 +++++++++------- docker-compose.yml | 62 +++------------------------------------------- 2 files changed, 16 insertions(+), 67 deletions(-) diff --git a/README.sh b/README.sh index 44e2ecf..e803974 100755 --- a/README.sh +++ b/README.sh @@ -28,13 +28,16 @@ docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || e docker-compose up setup docker-compose up -d -while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done sleep 5 -docker-compose exec cli kafkacat -b kafka-2:9092 -t test -q -c 10 -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n' -docker-compose exec cli kafkacat -b kafka-2:9092 -t test -q -c 10 -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n' -docker-compose exec cli kafkacat -b kafka-2:9092 -t test -q -c 10 -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n' - -docker-compose stop peter klaus beate franz uschi consumer-1 consumer-2 consumer-3 -docker-compose logs consumer-1 -docker-compose logs consumer-2 -docker-compose logs consumer-3 + +docker-compose restart consumer + +sleep 5 + +docker-compose stop consumer producer +docker-compose logs consumer + +echo "Received messages for test/0" +docker-compose logs consumer | grep test/0 +echo "Received messages for test/1" +docker-compose logs consumer | grep test/1 diff --git a/docker-compose.yml b/docker-compose.yml index 449e2ac..7739b2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,63 +74,9 @@ services: command: sleep infinity producer: - image: juplo/rest-producer:1.0-SNAPSHOT - ports: - - 8080:8080 - environment: - server.port: 8080 - producer.bootstrap-server: kafka:9092 - producer.client-id: producer - producer.topic: test - - peter: - image: juplo/rest-client:1.0-SNAPSHOT - environment: - server.port: 8080 - rest-client.baseUrl: http://producer:8080 - rest-client.username: peter - rest-client.throttle-ms: 1000 - - klaus: - image: juplo/rest-client:1.0-SNAPSHOT - environment: - server.port: 8080 - rest-client.baseUrl: http://producer:8080 - rest-client.username: klaus - rest-client.throttle-ms: 1100 - - beate: - image: juplo/rest-client:1.0-SNAPSHOT - environment: - server.port: 8080 - rest-client.baseUrl: http://producer:8080 - rest-client.username: beate - rest-client.throttle-ms: 900 - - franz: - image: juplo/rest-client:1.0-SNAPSHOT - environment: - server.port: 8080 - rest-client.baseUrl: http://producer:8080 - rest-client.username: franz - rest-client.throttle-ms: 800 - - uschi: - image: juplo/rest-client:1.0-SNAPSHOT - environment: - server.port: 8080 - rest-client.baseUrl: http://producer:8080 - rest-client.username: uschi - rest-client.throttle-ms: 1200 - - consumer-1: - image: juplo/simple-consumer:1.0-SNAPSHOT - command: consumer-1 - - consumer-2: - image: juplo/simple-consumer:1.0-SNAPSHOT - command: consumer-2 + image: juplo/simple-producer:1.0-SNAPSHOT + command: producer - consumer-3: + consumer: image: juplo/simple-consumer:1.0-SNAPSHOT - command: consumer-3 + command: consumer -- 2.20.1