3 if [ "$1" = "cleanup" ]
11 if [[ $(docker image ls -q juplo/deduplicator:streams) == "" || "$1" = "build" ]]
14 docker build -t juplo/deduplicator:streams . || exit
16 echo "Using image existing image:"
17 docker image ls juplo/deduplicator:streams
20 docker-compose up -d zookeeper kafka
27 while ! [[ $(zookeeper-shell zookeeper:2181 ls /brokers/ids 2> /dev/null) =~ 1001 ]];
29 echo "Waiting for kafka...";
33 kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic input
34 kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic output
36 docker-compose up -d deduplicator
38 while ! [[ $(http :8080/actuator/health 2>/dev/null | jq -r .components.streams.status) == "RUNNING" ]];
40 echo "Waiting for Streams-Application...";
44 cat data.txt | kafkacat -K: -b localhost:9092 -t input
46 kafkacat -C -b localhost:9092 -t input -e | wc -l
47 kafkacat -C -b localhost:9092 -t output -e | wc -l
49 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^peter/ { print $2 }' > result_peter.txt
50 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^franz/ { print $2 }' > result_franz.txt
51 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^ute/ { print $2 }' > result_ute.txt
52 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^klaus/ { print $2 }' > result_klaus.txt
53 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^paul/ { print $2 }' > result_paul.txt
54 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^petra/ { print $2 }' > result_petra.txt
55 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | awk -F: '/^siggi/ { print $2 }' > result_siggi.txt