3 IMAGE=juplo/simple-producer:1.0-SNAPSHOT
5 if [ "$1" = "cleanup" ]
12 docker-compose up -d zookeeper kafka-1 kafka-2 kafka-3 cli
13 docker-compose rm -svf producer
16 $(docker image ls -q $IMAGE) == "" ||
20 mvn clean install || exit
22 echo "Using image existing images:"
23 docker image ls $IMAGE
26 echo "Waiting for the Kafka-Cluster to become ready..."
27 docker-compose exec cli cub kafka-ready -b kafka:9092 1 60 > /dev/null 2>&1 || exit 1
28 docker-compose up setup
32 docker-compose exec cli kafkacat -b kafka:9092 -t test -q -c 20 -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n'
34 docker-compose stop producer
35 docker-compose exec cli kafkacat -b kafka:9092 -t test -q -e -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n'
36 docker-compose logs producer