spring-projects / spring-projects/spring-boot

Allow Kafka Admin Client's security protocol to be configured when using custom KafkaConnectionDetails

Open
#38,342 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: pending-design-work theme: containers type: enhancement
Dominant language
Java
Stars
81.5k
Forks
42.7k
Avg merge
2d 4h
Merged PRs (30d)
65

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfiguration.java around lines 208-209, and trace how custom KafkaConnectionDetails are used for the AdminClient. Review the surrounding Kafka auto-configuration and existing tests if present. Done means the AdminClient security protocol can be configured when custom connection details are used without replacing the AdminClient bean.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka, spring-boot
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.