Der Rest-Producer schreibt in eine fixe Partition, wenn so konfiguriert
[demos/kafka/training] / docker-compose.yml
1 version: '3.2'
2 services:
3   zookeeper:
4     image: confluentinc/cp-zookeeper:7.0.2
5     environment:
6       ZOOKEEPER_CLIENT_PORT: 2181
7     ports:
8       - 2181:2181
9
10   kafka:
11     image: confluentinc/cp-kafka:7.0.2
12     environment:
13       KAFKA_BROKER_ID: 1
14       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
15       KAFKA_LISTENERS: DOCKER://:9092, LOCALHOST://:9082
16       KAFKA_ADVERTISED_LISTENERS: DOCKER://kafka:9092, LOCALHOST://localhost:9082
17       KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
18       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
19       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
20       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
21     ports:
22       - 9092:9082
23       - 9082:9082
24     depends_on:
25       - zookeeper
26
27   kafka-ui:
28     image: provectuslabs/kafka-ui:0.3.3
29     ports:
30       - 8080:8080
31     environment:
32       KAFKA_CLUSTERS_0_NAME: local
33       KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
34
35   cli:
36     image: juplo/toolbox
37     command: sleep infinity
38
39   producer-0:
40     image: juplo/rest-producer:1.0-SNAPSHOT
41     ports:
42       - 8000:8080
43     environment:
44       producer.bootstrap-server: kafka:9092
45       producer.client-id: producer
46       producer.topic: test
47       producer.partition: 0
48
49   producer-1:
50     image: juplo/rest-producer:1.0-SNAPSHOT
51     ports:
52       - 8001:8080
53     environment:
54       producer.bootstrap-server: kafka:9092
55       producer.client-id: producer
56       producer.topic: test
57       producer.partition: 1
58
59   peter:
60     image: juplo/rest-client:1.0-SNAPSHOT
61     environment:
62       rest-client.baseUrl: http://producer-1:8080
63       rest-client.username: peter
64       rest-client.throttle-ms: 1000
65
66   klaus:
67     image: juplo/rest-client:1.0-SNAPSHOT
68     environment:
69       rest-client.baseUrl: http://producer-1:8080
70       rest-client.username: klaus
71       rest-client.throttle-ms: 1100
72
73   beate:
74     image: juplo/rest-client:1.0-SNAPSHOT
75     environment:
76       rest-client.baseUrl: http://producer-0:8080
77       rest-client.username: beate
78       rest-client.throttle-ms: 900
79
80   franz:
81     image: juplo/rest-client:1.0-SNAPSHOT
82     environment:
83       rest-client.baseUrl: http://producer-1:8080
84       rest-client.username: franz
85       rest-client.throttle-ms: 800
86
87   uschi:
88     image: juplo/rest-client:1.0-SNAPSHOT
89     environment:
90       rest-client.baseUrl: http://producer-0:8080
91       rest-client.username: uschi
92       rest-client.throttle-ms: 1200
93
94   consumer:
95     image: juplo/counting-consumer:1.0-SNAPSHOT
96     ports:
97       - 8081:8081
98     environment:
99       consumer.bootstrap-server: kafka:9092
100       consumer.client-id: my-group
101       consumer.client-id: consumer
102       consumer.topic: test