projects
/
demos
/
kafka
/
training
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Nicht benötigte Ausgaben entfernt
[demos/kafka/training]
/
README.sh
diff --git
a/README.sh
b/README.sh
index
8b568c9
..
3bc7e8a
100755
(executable)
--- a/
README.sh
+++ b/
README.sh
@@
-5,11
+5,10
@@
IMAGE=juplo/rest-producer:1.0-SNAPSHOT
if [ "$1" = "cleanup" ]
then
docker-compose down -v
if [ "$1" = "cleanup" ]
then
docker-compose down -v
- mvn clean
exit
fi
exit
fi
-docker-compose up -d zookeeper kafka cli
+docker-compose up -d zookeeper kafka
-1 kafka-2 kafka-3
cli
if [[
$(docker image ls -q $IMAGE) == "" ||
if [[
$(docker image ls -q $IMAGE) == "" ||
@@
-23,77
+22,36
@@
else
fi
echo "Waiting for the Kafka-Cluster to become ready..."
fi
echo "Waiting for the Kafka-Cluster to become ready..."
-docker-compose exec cli cub kafka-ready -b kafka:9092
1
60 > /dev/null 2>&1 || exit 1
+docker-compose exec cli cub kafka-ready -b kafka:9092
3
60 > /dev/null 2>&1 || exit 1
docker-compose up setup
docker-compose up setup
-
docker-compose up -d
docker-compose up -d
-sleep 15
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
+while ! [[ $(http 0:8081/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for acks-1..."; sleep 1; done
+while ! [[ $(http 0:8082/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for acks-all..."; sleep 1; done
-http post :8081/stop
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
+# tag::foo[]
+echo foo | http -v :8081/acks-1
+echo foo | http -v :8082/acks-all
+kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n'
+# end::foo[]
-http post :8081/start
+# tag::stop[]
+docker-compose stop kafka-1
+docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test
+# end::stop[]
+time echo bar | http -v :8081/acks-1
+time echo bar | http -v :8081/acks-1
+time echo bar | http -v :8082/acks-all
+time echo bar | http -v :8082/acks-all
sleep 1
sleep 1
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
-sleep 1
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
-sleep 1
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
-sleep 1
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
-sleep 1
-http :8081/status
-http :8082/status
-http :8083/status
-http :8084/status
-http :8085/status
-http :8000/seen
-
-http post :8081/stop
-http :8081/status
-http post :8082/stop
-http :8082/status
-http post :8083/stop
-http :8083/status
-http post :8084/stop
-http :8084/status
-http post :8085/stop
-http :8085/status
+kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n'
-http :8000/seen
-http post :8000/stop
+docker-compose stop kafka-3
+docker-compose exec cli kafka-topics --bootstrap-server kafka:9092 --describe --topic test
-docker-compose logs producer
+time echo foobar | http -v :8081/acks-1
+time echo foobar | http -v :8081/acks-1
+time echo foobar | http -v :8082/acks-all
+sleep 1
+kafkacat -C -b :9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n'