3 IMAGE=juplo/simple-producer:1.0-SNAPSHOT
5 if [ "$1" = "cleanup" ]
7 docker-compose down -v --remove-orphans
12 docker-compose up -d 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 docker-compose up setup
28 docker-compose up -d producer
31 docker-compose exec cli kafkacat -b kafka:9092 -t test -c 20 -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n'
33 docker-compose stop producer
34 docker-compose exec cli kafkacat -b kafka:9092 -t test -e -f'topic=%t\tpartition=%p\toffset=%o\tkey=%k\tvalue=%s\n'
35 docker-compose logs producer