Producer & Consumer greifen über abgesicherte Adresse zu
authorKai Moritz <kai@juplo.de>
Fri, 13 Oct 2023 16:31:58 +0000 (18:31 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 10 Nov 2023 12:49:41 +0000 (13:49 +0100)
docker/docker-compose.yml

index b0f7908..fd6da9d 100644 (file)
@@ -348,24 +348,40 @@ services:
       spring.kafka.client-id: producer
       spring.kafka.template.default-topic: test
       spring.kafka.producer.properties.linger.ms: 100
+      spring.kafka.jaas.enabled: "true"
+      spring.kafka.properties.security.protocol: SASL_PLAINTEXT
+      spring.kafka.properties.sasl.mechanism: PLAIN
+      spring.kafka.properties.sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="client" password="client-secret";
 
   consumer-1:
     image: juplo/spring-consumer:1.0-SNAPSHOT
     environment:
       spring.kafka.bootstrap-servers: kafka-1:9092, kafka-2:9092, kafka-3:9092
       spring.kafka.client-id: consumer-1
+      spring.kafka.jaas.enabled: "true"
+      spring.kafka.properties.security.protocol: SASL_PLAINTEXT
+      spring.kafka.properties.sasl.mechanism: PLAIN
+      spring.kafka.properties.sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="client" password="client-secret";
 
   consumer-2:
     image: juplo/spring-consumer:1.0-SNAPSHOT
     environment:
       spring.kafka.bootstrap-servers: kafka-1:9092, kafka-2:9092, kafka-3:9092
       spring.kafka.client-id: consumer-2
+      spring.kafka.jaas.enabled: "true"
+      spring.kafka.properties.security.protocol: SASL_PLAINTEXT
+      spring.kafka.properties.sasl.mechanism: PLAIN
+      spring.kafka.properties.sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="client" password="client-secret";
 
   consumer-3:
     image: juplo/spring-consumer:1.0-SNAPSHOT
     environment:
       spring.kafka.bootstrap-servers: kafka-1:9092, kafka-2:9092, kafka-3:9092
       spring.kafka.client-id: consumer-3
+      spring.kafka.jaas.enabled: "true"
+      spring.kafka.properties.security.protocol: SASL_PLAINTEXT
+      spring.kafka.properties.sasl.mechanism: PLAIN
+      spring.kafka.properties.sasl.jaas.config: org.apache.kafka.common.security.plain.PlainLoginModule required username="client" password="client-secret";
 
 volumes:
   zookeeper-data: