Fix: Übung Consumer-Groups mit simple-consumer
authorKai Moritz <kai@juplo.de>
Thu, 29 Sep 2022 20:17:12 +0000 (22:17 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 29 Sep 2022 20:17:12 +0000 (22:17 +0200)
Dockerfile
docker-compose.yml

index 3aefb4b..73b568e 100644 (file)
@@ -2,5 +2,5 @@ FROM openjdk:11-jre
 VOLUME /tmp
 COPY target/*.jar /opt/app.jar
 COPY target/libs /opt/libs
-ENTRYPOINT [ "java", "-jar", "/opt/app.jar", "kafka:9092", "test", "my-group" ]
+ENTRYPOINT [ "java", "-jar", "/opt/app.jar" ]
 CMD [ "DCKR" ]
index 7739b2b..9422b3a 100644 (file)
@@ -77,6 +77,24 @@ services:
     image: juplo/simple-producer:1.0-SNAPSHOT
     command: producer
 
-  consumer:
+  consumer-1:
     image: juplo/simple-consumer:1.0-SNAPSHOT
-    command: consumer
+    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 ]
+
+  consumer-3:
+    image: juplo/simple-consumer:1.0-SNAPSHOT
+    command: [ kafka:9092, test, my-group, consumer-3 ]
+
+  spikzettel:
+    image: juplo/toolbox
+    command: >
+      bash -c '
+        kafka-console-consumer \
+          --bootstrap-server kafka:9092 \
+          --topic __consumer_offsets --from-beginning \
+          --formatter "kafka.coordinator.group.GroupMetadataManager\$$OffsetsMessageFormatter"
+      '