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
+docker-compose up -d producer consumer-1
while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
echo barbar | http -v :8080/foo
docker-compose logs producer
-docker-compose logs consumer
+docker-compose logs consumer-1
producer.client-id: producer
producer.topic: test
- consumer:
+ peter:
image: juplo/toolbox
- command: kafkacat -C -b kafka:9092 -t test -o 0 -f'p=%p|o=%o|k=%k|v=%s\n'
+ command: >
+ bash -c "
+ while [[ true ]];
+ do
+ echo foo | http -v producer:8080/peter;
+ sleep 1;
+ done
+ "
+
+ klaus:
+ image: juplo/toolbox
+ command: >
+ bash -c "
+ while [[ true ]];
+ do
+ echo bar | http -v producer:8080/klaus;
+ sleep 1;
+ done
+ "
+
+ consumer-1:
+ image: juplo/simple-consumer:1.0-SNAPSHOT
+ command: consumer-1
+
+ consumer-2:
+ image: juplo/simple-consumer:1.0-SNAPSHOT
+ command: consumer-2
+
+ consumer-3:
+ image: juplo/simple-consumer:1.0-SNAPSHOT
+ command: 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"
+ '