projects
/
demos
/
kafka
/
training
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Setup und Beispiel in `README.sh` vereinfacht
[demos/kafka/training]
/
README.sh
diff --git
a/README.sh
b/README.sh
index
4f7f017
..
8451679
100755
(executable)
--- a/
README.sh
+++ b/
README.sh
@@
-1,37
+1,36
@@
#!/bin/bash
#!/bin/bash
-IMAGE=juplo/rest-producer:1.0-SNAPSHOT
+IMAGE=juplo/rest-producer
-json
:1.0-SNAPSHOT
if [ "$1" = "cleanup" ]
then
if [ "$1" = "cleanup" ]
then
- docker-compose down -v
+ docker-compose down -v
--remove-orphans
mvn clean
exit
fi
mvn clean
exit
fi
-docker-compose up -d zookeeper kafka cli
+docker-compose up -d kafka-1 kafka-2 kafka-3 cli
+docker-compose rm -svf producer
if [[
$(docker image ls -q $IMAGE) == "" ||
"$1" = "build"
]]
then
if [[
$(docker image ls -q $IMAGE) == "" ||
"$1" = "build"
]]
then
- mvn install || exit
+ mvn
clean
install || exit
else
echo "Using image existing images:"
docker image ls $IMAGE
fi
else
echo "Using image existing images:"
docker image ls $IMAGE
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 up setup
docker-compose up setup
-docker-compose up -d
-while ! [[ $(http -b :8080/actuator/health | jq -r .status) =~ "UP" ]]; do echo Waiting for :8080/actuator/health; sleep 1; done
+docker-compose ps
+docker-compose up -d producer
+
+while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
+
+echo -n 3 | http -v :8080/foo;
-# tag::http[]
-echo -n bar | http -v :8080/foo
-echo -n foo | http -v :8080/bar X-id:666
-# end::http[]
# tag::kafkacat[]
# tag::kafkacat[]
-docker-compose exec cli kafkacat -b kafka:9092 -t test -f "%p|%o|%k=%s|%h\n" -e
+kafkacat -b :9092 -t test -o 0 -e -f 'p=%p|o=%o|k=%k|h=%h|v=%s\n'
# end::kafkacat[]
# end::kafkacat[]