简体   繁体   中英

Required configs for spring kafka

what are the required configs for spring Kafka?

You need to add properties for both producer and consumer in application.yml to make it work fine.

spring:
  kafka:
    properties:
      security.protocol: SSL
      ssl:
        endpoint:
          identification:
            algorithm: ''
    consumer:
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      bootstrap-servers: kafka-url:9093
      group-id: "group-id"
      auto-offset-reset: latest
      enable-auto-commit: true
      ssl:
        keystore-location: file:
        truststore-location: file:
        keystore-password: 
        truststore-password: 

    producer:
      bootstrap-servers: kafka-url:9093
      value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
      ssl:
        keystore-location: file:
        truststore-location: file:
        keystore-password: 
        truststore-password: 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM