projects
/
demos
/
kafka
/
deduplication
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added actuators and implemented an indicator that reports the streams-state
[demos/kafka/deduplication]
/
README.sh
diff --git
a/README.sh
b/README.sh
index
6646d24
..
00383c4
100755
(executable)
--- a/
README.sh
+++ b/
README.sh
@@
-7,20
+7,35
@@
then
exit
fi
exit
fi
-mvn package
-
-docker build -t juplo/deduplicator:streams .
+if [[ $(docker image ls -q juplo/deduplicator:streams) == "" ]]
+then
+ mvn package
+ docker build -t juplo/deduplicator:streams .
+else
+ echo "Using image existing image:"
+ docker image ls juplo/deduplicator:streams
+fi
docker-compose up -d zookeeper kafka
docker-compose up -d zookeeper kafka
-while ! [[ $(zookeeper-shell zookeeper:2181 ls /brokers/ids 2> /dev/null) =~ 1001 ]]; do echo "Waiting for kafka..."; sleep 1; done
+while ! [[ $(zookeeper-shell zookeeper:2181 ls /brokers/ids 2> /dev/null) =~ 1001 ]];
+do
+ echo "Waiting for kafka...";
+ sleep 1;
+done
kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic input
kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic output
docker-compose up -d deduplicator
kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic input
kafka-topics --create --zookeeper zookeeper:2181 --replication-factor 1 --partitions 3 --topic output
docker-compose up -d deduplicator
+
+while ! [[ $(http :8080/actuator/health 2>/dev/null | jq -r .components.streams.status) == "RUNNING" ]];
+do
+ echo "Waiting for Streams-Application...";
+ sleep 1;
+done
+
cat data.txt | kafkacat -K: -b localhost:9092 -t input
cat data.txt | kafkacat -K: -b localhost:9092 -t input
-sleep 5
kafkacat -C -b localhost:9092 -t input -e | wc -l
kafkacat -C -b localhost:9092 -t output -e | wc -l
kafkacat -C -b localhost:9092 -t input -e | wc -l
kafkacat -C -b localhost:9092 -t output -e | wc -l