Verbesserungen & Korrekturen aus simple-consumer übernommen spring-consumer--kafkalistener---lvm-2-tage--easy-path
authorKai Moritz <kai@juplo.de>
Tue, 22 Nov 2022 22:43:14 +0000 (23:43 +0100)
committerKai Moritz <kai@juplo.de>
Wed, 23 Nov 2022 02:40:38 +0000 (03:40 +0100)
README.sh
docker-compose.yml
pom.xml
src/main/resources/application.yml

index c0a65f0..20c873e 100755 (executable)
--- a/README.sh
+++ b/README.sh
@@ -4,14 +4,13 @@ IMAGE=juplo/spring-consumer-kafkalistener:1.0-SNAPSHOT
 
 if [ "$1" = "cleanup" ]
 then
-  docker-compose down -v
+  docker-compose down -v --remove-orphans
   mvn clean
   exit
 fi
 
-trap 'kill $(jobs -p) 2>/dev/null' EXIT
-
-docker-compose up -d kafka-0 kafka-1 kafka-2 kafka-3 cli
+docker-compose up -d kafka-1 kafka-2 kafka-3 cli
+docker-compose rm -svf consumer
 
 if [[
   $(docker image ls -q $IMAGE) == "" ||
@@ -25,6 +24,15 @@ else
 fi
 
 docker-compose up setup
+docker-compose up -d producer
+docker-compose ps
+
 docker-compose up -d consumer
-docker-compose up producer
+sleep 5
+docker-compose stop consumer
+
+docker-compose start consumer
+sleep 5
+
+docker-compose stop producer consumer
 docker-compose logs consumer
index 9ed194b..ddef330 100644 (file)
@@ -101,15 +101,17 @@ services:
   cli:
     image: juplo/toolbox
     command: sleep infinity
+    depends_on:
+      - kafka-1
+      - kafka-2
+      - kafka-3
 
   producer:
-    image: juplo/supersimple-producer:1.0-SNAPSHOT
-    environment:
-      spring.kafka.bootstrap-servers: kafka:9092
+    image: juplo/simple-producer:1.0-SNAPSHOT
+    command: kafka:9092 test producer
 
   consumer:
     image: juplo/spring-consumer-kafkalistener:1.0-SNAPSHOT
     environment:
       spring.kafka.bootstrap-servers: kafka:9092
       spring.kafka.client-id: consumer
-
diff --git a/pom.xml b/pom.xml
index e28ae92..b908802 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -13,9 +13,9 @@
 
   <groupId>de.juplo.kafka</groupId>
   <artifactId>spring-consumer-kafkalistener</artifactId>
-  <version>1.0-SNAPSHOT</version>
   <name>Spring Consumer</name>
   <description>Super Simple Consumer-Group, that is implemented as Spring-Boot application and configured by Spring Kafka</description>
+  <version>1.0-SNAPSHOT</version>
 
   <properties>
     <java.version>11</java.version>
 
   <build>
     <plugins>
+      <plugin>
+        <groupId>pl.project13.maven</groupId>
+        <artifactId>git-commit-id-plugin</artifactId>
+      </plugin>
       <plugin>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-maven-plugin</artifactId>
index 9ca7eb8..40f7310 100644 (file)
@@ -31,6 +31,6 @@ logging:
   level:
     root: INFO
     de.juplo: DEBUG
-    org.springframework.kafka: DEBUG
+    org.springframework.kafka: INFO
 server:
   port: 8881