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
+docker compose -f docker/docker-compose.yml rm -svf setup producer
if [[
$(docker image ls -q $IMAGE) == "" ||
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
+sleep 5
+
+docker compose -f docker/docker-compose.yml pause kafka-1 kafka-3
+sleep 20
+docker compose -f docker/docker-compose.yml unpause kafka-1 kafka-3
+sleep 3
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\/.'
+echo "Empfangen:"
+docker compose -f docker/docker-compose.yml exec cli kafkacat -b kafka:9092 -t test -e -q -J
-docker compose -f docker/docker-compose.yml stop consumer-1 consumer-2
+docker compose -f docker/docker-compose.yml logs producer | grep ERROR
kafka-topics --bootstrap-server kafka:9092 \
--create \
--topic test \
- --partitions 2 \
+ --partitions 1 \
--replication-factor 3 \
--config min.insync.replicas=2 \
&& echo Das Topic \'test\' wurde erfolgreich angelegt: \
juplo.bootstrap-server: kafka:9092
juplo.client-id: producer
juplo.producer.topic: test
+ juplo.producer.delivery-timeout: 2147483647ms
+ juplo.producer.buffer-memory: 32768
- consumer-1:
+ consumer:
image: juplo/simple-consumer:1.0-SNAPSHOT
- 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
+ command: kafka:9092 test my-group consumer
volumes:
zookeeper-data: