From: Kai Moritz Date: Fri, 5 Aug 2022 09:48:21 +0000 (+0200) Subject: Anpassungen an Setup und README.sh aus Branch 'origin/rest-producer' X-Git-Tag: acks---lvm-2-tage~6 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=eaf7384d19976f92e3890894f2b31cbeacc4fd29;p=demos%2Fkafka%2Ftraining Anpassungen an Setup und README.sh aus Branch 'origin/rest-producer' --- eaf7384d19976f92e3890894f2b31cbeacc4fd29 diff --cc README.sh index 6e6c10e,d2dccf8..e430820 --- a/README.sh +++ b/README.sh @@@ -27,26 -27,36 +27,25 @@@ docker-compose exec cli cub kafka-read docker-compose up setup docker-compose up -d - sleep 10 -while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done - -echo foo | http -v :8080/bar -echo bar | http -v :8080/foo -echo foobar | http -v :8080/bar -dd if=/dev/zero bs=1024 count=1024 | http -v :8080/bar -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo -echo foofoo | http -v :8080/bar -echo barbar | http -v :8080/foo - -docker-compose logs producer -docker-compose logs consumer ++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 + +# tag::foo[] +echo foo | http -v :8081/foo-acks-1 +echo foo | http -v :8082/foo-acks-all +http -v :8000/seen +# end::foo[] + +# tag::stop[] +docker-compose stop kafka-1 +# end::stop[] + +echo bar | http -v :8081/bar-acks-1 +echo bar | http -v :8082/bar-acks-all - http -v :8000/seen ++docker-compose exec cli kafkacat -C -b kafka:9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n' + +docker-compose stop kafka-3 + +echo foobar | http -v :8081/foobar-acks-1 +echo foobar | http -v :8082/foobar-acks-all - http -v :8000/seen - - docker-compose stop acks-all acks-1 consumer ++docker-compose exec cli kafkacat -C -b kafka:9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n' diff --cc docker-compose.yml index f4ec680,7ae8d9b..116cd9a --- a/docker-compose.yml +++ b/docker-compose.yml @@@ -80,28 -80,9 +80,21 @@@ services environment: server.port: 8080 producer.bootstrap-server: kafka:9092 - producer.client-id: producer + producer.client-id: acks-all producer.topic: test + producer.acks: all + + acks-1: + image: juplo/rest-producer:1.0-SNAPSHOT + ports: + - 8081:8080 + environment: + server.port: 8080 + producer.bootstrap-server: kafka:9092 + producer.client-id: acks-1 + producer.topic: test + producer.acks: 1 consumer: - image: juplo/endless-consumer:1.0-SNAPSHOT - ports: - - 8000:8080 - environment: - server.port: 8080 - consumer.bootstrap-server: kafka:9092 - consumer.client-id: my-group - consumer.client-id: consumer - consumer.topic: test + image: juplo/toolbox + command: kafkacat -C -b kafka:9092 -t test -o 0 -f'p=%p|o=%o|k=%k|v=%s\n'