spring-attic / spring-integration-kafka

Apache License 2.0
324 stars 180 forks source link

Automatically set "security.protocol" property to "SSL" if "ssl" property is set #294

Closed Woodz closed 4 years ago

Woodz commented 4 years ago

I believe that in all scenarios where SpringBoot autoconfig for Kafka has "ssl" property set, "security.protocol" should be set to "SSL". Therefore, to avoid confusion (e.g. #157) and to minimise extra config, I propose that the Kafka Spring client sets this property automatically, thus avoiding the need to set it via the "properties" map in the YML file or programmatically.

Spring Boot version: 2.1.9.RELEASE Kafka version: 2.0.1

Example application.yml:

kafka:
  consumer:
    bootstrap-servers: <server>
    key-serializer: org.apache.kafka.common.serialization.StringSerializer
    value-serializer: org.apache.kafka.common.serialization.StringSerializer
    ssl:
      truststore-location: <trust store location>
      truststore-password: <password>
    properties:
      security.protocol: SSL
garyrussell commented 4 years ago

This auto configuration is in spring boot, not here: https://github.com/spring-projects/spring-boot/issues/19220.

Woodz commented 4 years ago

This auto configuration is in spring boot, not here: spring-projects/spring-boot#19220.

Agreed @garyrussell, apologies for raising an incorrect issue