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:
https://github.com/spring-projects/spring-boot/blob/4a6762a356aa1d31c869e07c12db4ae48c39cf3d/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java#L208-L209
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
Comment From: LukasHeimann
I'm also interested in having a KafkaAdminCustomizer to modify the default bean, similar to how there already is a customizer for the DefaultKafkaProducerFactory and the DefaultKafkaConsumerFactory (see https://github.com/spring-projects/spring-boot/issues/12003 and https://github.com/spring-projects/spring-boot/commit/d16074d8fdc457107177bca026635e4575fe0c08)