Spring Boot kafka集成配置 添加密码认证

spring:
  kafka:
    bootstrap-servers: localhost:9092
    template:
      default-topic: topic
    producer:
      key-serializer: org.apache.kafka.common.serialization.StringSerializer
      value-serializer: org.apache.kafka.common.serialization.StringSerializer
    consumer:
      group-id: consumer-group
      enable-auto-commit: true
      auto-commit-interval: 1000
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
    properties:
      security:
        protocol: SASL_PLAINTEXT
      sasl:
        mechanism: SCRAM-SHA-256
        jaas:
          config: 'org.apache.kafka.common.security.scram.ScramLoginModule required username="username" password="password";'  

 

posted @ 2020-09-17 16:57  April.Chen  阅读(7290)  评论(0编辑  收藏  举报