Skip to content

Configure KafkaAdmin for observation - #50454

Open
henriquejsza wants to merge 1 commit into
spring-projects:mainfrom
henriquejsza:gh-38830-kafka-admin-observation
Open

Configure KafkaAdmin for observation#50454
henriquejsza wants to merge 1 commit into
spring-projects:mainfrom
henriquejsza:gh-38830-kafka-admin-observation

Conversation

@henriquejsza

Copy link
Copy Markdown
Contributor

Closes gh-38830

This PR adds dedicated admin property groups for Kafka template and listener observation support. It allows the auto-configured KafkaTemplate and listener containers to use internal KafkaAdmin instances configured from spring.kafka.template.admin.* and spring.kafka.listener.admin.* when looking up the Kafka cluster id.

The listener container customization composes with a user-provided ContainerCustomizer so existing customization remains applied.

Tests:

  • JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64 ./gradlew :module:spring-boot-kafka:test --tests org.springframework.boot.kafka.autoconfigure.KafkaAutoConfigurationTests --tests org.springframework.boot.kafka.autoconfigure.ConcurrentKafkaListenerContainerFactoryConfigurerTests
  • JAVA_HOME=/usr/lib/jvm/java-25-openjdk-amd64 ./gradlew :module:spring-boot-kafka:checkFormat :module:spring-boot-kafka:checkstyleMain :module:spring-boot-kafka:checkstyleTest
  • git diff --check

Allow KafkaTemplate and listener containers to use dedicated admin properties when looking up the Kafka cluster id for observation.

Signed-off-by: henriquejsza <henriquejsza@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 17, 2026
@snicoll snicoll self-assigned this Jul 22, 2026
@snicoll snicoll added the status: on-hold We can't start working on this issue yet label Jul 22, 2026
@snicoll

snicoll commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thanks for the PR! I put it on hold as I'd like some clarity on what we're trying to achieve. I've asked on the linked issue.

@henriquejsza

Copy link
Copy Markdown
Contributor Author

Thanks Stéphane, totally fair. I will pause this PR until the issue discussion defines the exact goal, then I will update it accordingly.

@snicoll snicoll removed their assignment Jul 27, 2026
@henriquejsza

Copy link
Copy Markdown
Contributor Author

Artem's follow-up in gh-38830 clarifies the intended scope: the existing auto-configured KafkaAdmin bean remains the injectable management bean, while the template/listener-specific instances are not beans and are used only for cluster-id lookup. That matches this PR's design.

I'll keep the code paused (and avoid rebasing the current conflicts) until you confirm that this resolves the scope concern. Once confirmed, I'll rebase and refresh the validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: on-hold We can't start working on this issue yet status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support consumer, producer, listener and template specific Kafka Admin properties

3 participants