3 if [ "$1" = "cleanup" ]
10 if [[ $(docker image ls -q juplo/deduplicator:streams) == "" ]]
13 docker build -t juplo/deduplicator:streams .
15 echo "Using image existing image:"
16 docker image ls juplo/deduplicator:streams
19 docker-compose up -d zookeeper kafka
21 while ! [[ $(zookeeper-shell zookeeper:2181 ls /brokers/ids 2> /dev/null) =~ 1001 ]];
23 echo "Waiting for kafka...";
27 kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic input
28 kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic output
30 docker-compose up -d deduplicator
32 while ! [[ $(http :8080/actuator/health 2>/dev/null | jq -r .components.streams.status) == "RUNNING" ]];
34 echo "Waiting for Streams-Application...";
38 cat data.txt | kafkacat -K: -b localhost:9092 -t input
40 kafkacat -C -b localhost:9092 -t input -e | wc -l
41 kafkacat -C -b localhost:9092 -t output -e | wc -l
43 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^0 > result_0.txt
44 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^1 > result_1.txt
45 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^2 > result_2.txt
46 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^3 > result_3.txt
47 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^4 > result_4.txt
48 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^5 > result_5.txt
49 kafkacat -C -b localhost:9092 -t output -e -f'%k:%s\n' | grep ^6 > result_6.txt