From 7c726900b6a97d002ede45062ccfefd0e0b15438 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 29 Oct 2024 18:57:58 +0100 Subject: [PATCH] Vorlage --- README.sh | 42 ------------------- .../java/de/juplo/kafka/ExampleProducer.java | 1 - 2 files changed, 43 deletions(-) delete mode 100755 README.sh diff --git a/README.sh b/README.sh deleted file mode 100755 index 668e756..0000000 --- a/README.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -IMAGE=juplo/spring-producer:1.0-fixedsharding-SNAPSHOT - -if [ "$1" = "cleanup" ] -then - docker compose -f docker/docker-compose.yml down -t0 -v --remove-orphans - mvn clean - exit -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 - -if [[ - $(docker image ls -q $IMAGE) == "" || - "$1" = "build" -]] -then - mvn clean install || exit -else - echo "Using image existing images:" - docker image ls $IMAGE -fi - -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 - -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\/.' - -docker compose -f docker/docker-compose.yml stop consumer-1 consumer-2 diff --git a/src/main/java/de/juplo/kafka/ExampleProducer.java b/src/main/java/de/juplo/kafka/ExampleProducer.java index e2811f0..a5391e7 100644 --- a/src/main/java/de/juplo/kafka/ExampleProducer.java +++ b/src/main/java/de/juplo/kafka/ExampleProducer.java @@ -87,7 +87,6 @@ public class ExampleProducer implements Runnable final ProducerRecord record = new ProducerRecord<>( topic, // Topic - partition, // Partition key, // Key value // Value ); -- 2.20.1