From 08261cb2d29a1e1c5b4947d7e4882fa76657f8c2 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 23 Nov 2022 04:17:58 +0100 Subject: [PATCH] =?utf8?q?Korrekturen=20&=20Verbesserungen=20aus=20produce?= =?utf8?q?r-supersimple=20=C3=BCbernommen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++-- README.sh | 4 +++- docker-compose.yml | 5 +++++ pom.xml | 2 +- src/main/java/de/juplo/kafka/Application.java | 2 -- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9f3eac8..16ee25e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM openjdk:11-jre VOLUME /tmp COPY target/*.jar /opt/app.jar -ENTRYPOINT [ "java", "-jar", "/opt/app.jar", "kafka:9092", "test" ] -CMD [ "DCKR" ] +ENTRYPOINT [ "java", "-jar", "/opt/app.jar" ] +CMD [] diff --git a/README.sh b/README.sh index 10e79a0..b10c65a 100755 --- a/README.sh +++ b/README.sh @@ -4,7 +4,7 @@ IMAGE=juplo/supersimple-producer:1.0-SNAPSHOT if [ "$1" = "cleanup" ] then - docker-compose down -v + docker-compose down -v --remove-orphans mvn clean exit fi @@ -24,6 +24,8 @@ else fi docker-compose up setup +docker-compose ps + docker-compose up -d acks-all acks-1 sleep 5 docker-compose stop kafka-1 diff --git a/docker-compose.yml b/docker-compose.yml index f63713d..e910e9c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -84,6 +84,7 @@ services: depends_on: - kafka-0 + setup: image: juplo/toolbox command: > @@ -100,6 +101,10 @@ services: cli: image: juplo/toolbox command: sleep infinity + depends_on: + - kafka-1 + - kafka-2 + - kafka-3 acks-all: image: juplo/supersimple-producer:1.0-SNAPSHOT diff --git a/pom.xml b/pom.xml index 058aa14..ccab861 100644 --- a/pom.xml +++ b/pom.xml @@ -13,9 +13,9 @@ de.juplo.kafka supersimple-producer - 1.0-SNAPSHOT Super Simple Producer Most minimal Kafka Producer ever! + 1.0-SNAPSHOT 11 diff --git a/src/main/java/de/juplo/kafka/Application.java b/src/main/java/de/juplo/kafka/Application.java index a0b96c2..4632e22 100644 --- a/src/main/java/de/juplo/kafka/Application.java +++ b/src/main/java/de/juplo/kafka/Application.java @@ -23,7 +23,6 @@ public class Application implements ApplicationRunner { for (int i = 0; true; i++) { - // tag::callback[] ListenableFuture> listenableFuture = kafkaTemplate.send("test", Long.toString(i%10), Long.toString(i)); @@ -35,7 +34,6 @@ public class Application implements ApplicationRunner result.getRecordMetadata().partition(), result.getRecordMetadata().offset()), e -> log.error("ERROR sendig message", e)); - // end::callback[] try { -- 2.20.1