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 rm -svf consumer-1
if [[
$(docker image ls -q $IMAGE) == "" ||
echo "Waiting for the Kafka-Cluster to become ready..."
docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
docker-compose up setup
-docker-compose up -d producer consumer-1
-
-sleep 5
-
-docker-compose restart consumer-1
-
-sleep 5
-
-docker-compose stop consumer-1 producer
-docker-compose logs consumer-1
-
-echo "Received messages for test/0"
-docker-compose logs consumer-1 | grep test/0
-echo "Received messages for test/1"
-docker-compose logs consumer-1 | grep test/1
+docker-compose up -d producer
+
+mvn spring-boot:run &
+sleep 10
+kill $(jobs -p)
+mvn spring-boot:run &
+sleep 10
+docker-compose stop producer
+kill $(jobs -p)
producer:
image: juplo/simple-producer:1.0-SNAPSHOT
command: producer
-
- consumer-1:
- 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
-
- consumer-3:
- image: juplo/simple-consumer:1.0-SNAPSHOT
- command: kafka:9092 test my-group consumer-3
-
- spikzettel:
- image: juplo/toolbox
- command: >
- bash -c '
- kafka-console-consumer \
- --bootstrap-server kafka:9092 \
- --topic __consumer_offsets --from-beginning \
- --formatter "kafka.coordinator.group.GroupMetadataManager\$$OffsetsMessageFormatter"
- '