while ! [[ $(http 0:8080/actuator/health 2> /dev/null) =~ "UP" ]]; do echo "Waiting for producer..."; sleep 1; done
-# tag::http[]
-echo -n bar | http -v :8080/foo
-echo -n foo | http -v :8080/bar X-id:666
-# end::http[]
-# tag::kafkacat[]
-docker-compose exec cli kafkacat -b kafka:9092 -t test -f "%p|%o|%k=%s|%h\n" -e
-# end::kafkacat[]
+# tag::success[]
+echo -n 'Hallo Welt!' | http -v :8080/foo
+# end::success[]
+
+# tag::failure[]
+dd if=/dev/zero bs=1024 count=1024 | http -v :8080/bar
+# end::failure[]
+
+# tag::timeout[]
+docker-compose stop kafka-1 kafka-2 kafka-3
+echo -n 'Hallo again...' | http -v --timeout 30 :8080/foo
+# end::timeout[]
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
ports:
- 9081:9081
+ depends_on:
+ - kafka-0
kafka-2:
image: bitnami/kafka:3.3.1
default:
aliases:
- kafka
+ depends_on:
+ - kafka-0
kafka-3:
image: bitnami/kafka:3.3.1
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "false"
ports:
- 9083:9083
+ depends_on:
+ - kafka-0
+
setup:
image: juplo/toolbox
kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2 --replication-factor 3 --config min.insync.replicas=2
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
"
+ depends_on:
+ - kafka-1
+ - kafka-2
+ - kafka-3
cli:
image: juplo/toolbox
command: sleep infinity
+ depends_on:
+ - kafka-1
+ - kafka-2
+ - kafka-3
producer:
image: juplo/rest-producer:1.0-SNAPSHOT
producer.client-id: producer
producer.topic: test
- peter:
- image: juplo/rest-client:1.0-SNAPSHOT
- environment:
- server.port: 8080
- rest-client.baseUrl: http://producer:8080
- rest-client.username: peter
- rest-client.throttle-ms: 1000
-
- klaus:
- image: juplo/rest-client:1.0-SNAPSHOT
- environment:
- server.port: 8080
- rest-client.baseUrl: http://producer:8080
- rest-client.username: klaus
- rest-client.throttle-ms: 1100
-
- beate:
- image: juplo/rest-client:1.0-SNAPSHOT
- environment:
- server.port: 8080
- rest-client.baseUrl: http://producer:8080
- rest-client.username: beate
- rest-client.throttle-ms: 900
-
- franz:
- image: juplo/rest-client:1.0-SNAPSHOT
- environment:
- server.port: 8080
- rest-client.baseUrl: http://producer:8080
- rest-client.username: franz
- rest-client.throttle-ms: 800
-
- uschi:
- image: juplo/rest-client:1.0-SNAPSHOT
- environment:
- server.port: 8080
- rest-client.baseUrl: http://producer:8080
- rest-client.username: uschi
- rest-client.throttle-ms: 1200
-
consumer:
- image: juplo/toolbox
- command: kafkacat -C -b kafka:9092 -t test -o 0 -f'p=%p|o=%o|k=%k|v=%s\n'
+ image: juplo/simple-consumer:1.0-SNAPSHOT
+ command: kafka:9092 test my-group consumer