depends_on:
- zookeeper
+ cli:
+ image: confluentinc/confluent-cli:7.1.3
+ command: sleep infinity
+
setup:
image: juplo/toolbox
command: >
bash -c "
- kafka-topics --bootstrap-server kafka:9092 --delete --if-exists --topic test
- kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 1 --replication-factor 3 --config min.insync.replicas=2
kafka-topics --bootstrap-server kafka:9092 --describe --topic test
+ kafka-topics --bootstrap-server kafka:9092 --delete --if-exists --topic test
+ kafka-topics --bootstrap-server kafka:9092 --create --topic test --partitions 2 --replication-factor 3 --config min.insync.replicas=2
+ kafka-topics --bootstrap-server kafka-1:9092 --describe --topic test
+ kafka-topics --bootstrap-server kafka-2:9092 --describe --topic test
+ kafka-topics --bootstrap-server kafka-3:9092 --describe --topic test
+ "
+ producer:
+ image: confluentinc/cp-kafkacat:7.1.3
+ command: >
+ bash -c "
+ echo 'hello world' | kafkacat -P -b kafka:9092 -t test -X acks=all
+ echo 'hello world' | kafkacat -P -b kafka:9092 -t test -X acks=all
+ echo 'hello world' | kafkacat -P -b kafka:9092 -t test -X acks=all
"
-
- cli:
- image: juplo/toolbox
- command: sleep infinity
-
- acks-all:
- image: juplo/rest-producer:1.0-SNAPSHOT
- ports:
- - 8082:8080
- environment:
- server.port: 8080
- producer.bootstrap-server: kafka:9092
- 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: confluentinc/cp-kafkacat:7.1.3
+ command: kafkacat -C -b kafka:9092 -t test -o 0 -e -f'p=%p|o=%o|k=%k|v=%s\n'