Skip to content

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

Open
@Exidex

Description

@Exidex

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: pending-design-workNeeds design work before any code can be developedtheme: containersTestcontainers, Docker Compose and Buildpack featurestype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions