WIP: Nicht vollendete Umbauten für spring-integration
[demos/kafka/wordcount] / docker-compose.yml
index 2594ac8..19f99c9 100644 (file)
@@ -17,6 +17,8 @@ services:
       KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER:PLAINTEXT, LOCALHOST:PLAINTEXT
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+      KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
+      KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
       KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
     ports:
       - 9092:9082
@@ -24,59 +26,84 @@ services:
     depends_on:
       - zookeeper
 
+
+  traefik:
+    image: "traefik:v2.5"
+    command:
+      #- "--log.level=DEBUG"
+      - "--api.insecure=true"
+      - "--providers.docker=true"
+      - "--providers.docker.exposedbydefault=false"
+      - "--entrypoints.web.address=:80"
+    ports:
+      - "80:80"
+      - "8080:8080"
+    volumes:
+      - "/var/run/docker.sock:/var/run/docker.sock:ro"
+
   recorder:
-    image: juplo/wordcount--recorder:1.0.0
+    image: juplo/wordcount--recorder:1.0.1
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.recorder.rule=Host(`recorder.localhost`)"
+      - "traefik.http.routers.recorder.entrypoints=web"
     environment:
       juplo.wordcount.recorder.bootstrap-server: kafka:9092
-      juplo.wordcount.recorder.topic: recordings
-    ports:
-      - 8081:8080
     depends_on:
       - kafka
 
   users:
-    image: juplo/wordcount--users:1.0.2
+    image: juplo/wordcount--users:1.0.4
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.users.rule=Host(`users.localhost`)"
+      - "traefik.http.routers.users.entrypoints=web"
     environment:
       juplo.wordcount.users.bootstrap-server: kafka:9092
-      juplo.wordcount.users.topic: users
-    ports:
-      - 8082:8080
+    depends_on:
+      - kafka
+
+  splitter:
+    image: juplo/wordcount--splitter:1.0.0-spring-integration
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.splitter.rule=Host(`splitter.localhost`)"
+      - "traefik.http.routers.splitter.entrypoints=web"
+    environment:
+      spring.kafka.bootstrap-servers: kafka:9092
     depends_on:
       - kafka
 
   counter:
-    image: juplo/wordcount--counter:1.0.0
+    image: juplo/wordcount--counter:1.1.0
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.counter.rule=Host(`counter.localhost`)"
+      - "traefik.http.routers.counter.entrypoints=web"
     environment:
       juplo.wordcount.counter.bootstrap-server: kafka:9092
-      juplo.wordcount.counter.application-id: counter
-      juplo.wordcount.counter.input-topic: recordings
-      juplo.wordcount.counter.output-topic: countings
-    ports:
-      - 8083:8080
     depends_on:
       - kafka
 
   top10:
-    image: juplo/wordcount--top10:1.0.0
+    image: juplo/wordcount--top10:1.0.1
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.top10.rule=Host(`top10.localhost`)"
+      - "traefik.http.routers.top10.entrypoints=web"
     environment:
       juplo.wordcount.top10.bootstrap-server: kafka:9092
-      juplo.wordcount.top10.application-id: top10
-      juplo.wordcount.top10.input-topic: countings
-      juplo.wordcount.top10.output-topic: top10
-    ports:
-      - 8084:8080
     depends_on:
       - kafka
 
   query:
-    image: juplo/wordcount--query:1.0.2
+    image: juplo/wordcount--query:1.0.4
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.query.rule=Host(`query.localhost`)"
+      - "traefik.http.routers.query.entrypoints=web"
     environment:
       juplo.wordcount.query.bootstrap-server: kafka:9092
-      juplo.wordcount.query.application-id: query
-      juplo.wordcount.query.ranking-input-topic: top10
-      juplo.wordcount.query.users-input-topic: users
-    ports:
-      - 8085:8080
     depends_on:
       - kafka
 
@@ -87,7 +114,7 @@ services:
       do
         /usr/games/fortune chalkboard
           | head -1
-          | http -v recorder:8080/bart;
+          | http -v recorder:8081/bart;
         echo;
         sleep 1;
       done"
@@ -99,7 +126,7 @@ services:
       do
         /usr/games/fortune computers
           | grep  -v '^[[:space:]]*--'
-          | http -v recorder:8080/nerd;
+          | http -v recorder:8081/nerd;
         echo;
         sleep 1;
       done"
@@ -111,7 +138,7 @@ services:
       do
         /usr/games/fortune riddles
           | awk -F':' '/^Q/ { print $$2 }'
-          | http -v recorder:8080/riddler;
+          | http -v recorder:8081/riddler;
         echo;
         sleep 1;
       done"
@@ -120,12 +147,29 @@ services:
     image: juplo/toolbox
     command: bash -c "
       cub kafka-ready -b kafka:9092 1 60 ;
-      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic recordings ;
-      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic users ;
-      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic countings ;
-      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --topic top10 ;
+      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic recordings ;
+      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic users ;
+      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic words ;
+      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic countings ;
+      kafka-topics --bootstrap-server kafka:9092 --create --partitions 10 --if-not-exists --topic top10 ;
       sleep infinity"
 
+  akhq:
+    image: tchiotludo/akhq:0.18.0
+    labels:
+      - "traefik.enable=true"
+      - "traefik.http.routers.akhq.rule=Host(`akhq.localhost`)"
+      - "traefik.http.routers.akhq.entrypoints=web"
+    expose:
+      - 8080
+    environment:
+      AKHQ_CONFIGURATION: |
+        akhq:
+          connections:
+            docker-kafka-server:
+              properties:
+                bootstrap.servers: "kafka:9092"
+
 networks:
   default:
     external: