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";'  

 

上一篇:java-在序列化和存储在Jarfile中时,有什么可以修改SerialVersionUID的?


下一篇:boost 序列化--C++--serialization--支持常用STL--内存数据文件持久化--继承序列化