spring:
kafka:
bootstrap-servers: IP:端口
listener:
missing-topics-fatal: false
properties:
sasl:
mechanism: PLAIN
jaas:
config: 'org.apache.kafka.common.security.plain.PlainLoginModule required username="用户名" password="密码";'
security:
protocol: SASL_PLAINTEXT
producer:
key-serializer: org.apache.kafka.common.serialization.StringSerializer
value-serializer: org.apache.kafka.common.serialization.StringSerializer
consumer:
group-id: test_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
参考:SpringBoot 支持Kafka安全认证 SASL/PLAINTEXT,账号密码认证