COPY target/*.jar /opt/app.jar
COPY target/libs /opt/libs
ENTRYPOINT [ "java", "-jar", "/opt/app.jar" ]
-CMD [ "DCKR" ]
+CMD [ ":9092", "test", "my-group", "DCKR" ]
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) == "" ||
docker-compose up setup
docker-compose up -d producer
+docker-compose ps
-java -jar target/simple-consumer-1.0-SNAPSHOT.jar &
+docker-compose up -d consumer
sleep 5
-kill $(jobs -p)
-java -jar target/simple-consumer-1.0-SNAPSHOT.jar &
+docker-compose stop consumer
+
+docker-compose start consumer
sleep 5
-docker-compose stop producer
-kill $(jobs -p)
+
+docker-compose stop producer consumer
+docker-compose logs consumer
producer:
image: juplo/simple-producer:1.0-SNAPSHOT
- command: producer
+ command: kafka:9092 test producer
+
+ consumer:
+ image: juplo/simple-consumer:1.0-SNAPSHOT
+ command: kafka:9092 test my-group consumer
<groupId>de.juplo.kafka</groupId>
<artifactId>simple-consumer</artifactId>
- <version>1.0-SNAPSHOT</version>
<name>Simple Consumer-Group</name>
<description>Super Simple Consumer-Group, that is implemented as a plain Java-program</description>
+ <version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>