Spring Boot hardcodes Kafka Admin Client security protocol to PLAINTEXT if custom KafkaConnectionDetails is used. For producer and consumer it is easy to work around using DefaultKafkaConsumerFactoryCustomizer and DefaultKafkaProducerFactoryCustomizer but AdminClient doesn't have similar customizer. Which means we cannot configure it security protocol in code.
Relevant piece of code:
|
if (!(connectionDetails instanceof PropertiesKafkaConnectionDetails)) { |
|
properties.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, "PLAINTEXT"); |
The only workaround I see is replacing AdminClient bean with custom one (which is not really desirable) or am I missing something?
Spring Boot version: 3.1.4
Spring Boot hardcodes Kafka Admin Client security protocol to PLAINTEXT if custom
KafkaConnectionDetailsis used. For producer and consumer it is easy to work around usingDefaultKafkaConsumerFactoryCustomizerandDefaultKafkaProducerFactoryCustomizerbutAdminClientdoesn't have similar customizer. Which means we cannot configure it security protocol in code.Relevant piece of code:
spring-boot/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java
Lines 208 to 209 in 4a6762a
The only workaround I see is replacing
AdminClientbean with custom one (which is not really desirable) or am I missing something?Spring Boot version: 3.1.4