Skip to content

Conversation

@rujche
Copy link
Member

@rujche rujche commented Dec 5, 2025

Description

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings December 5, 2025 06:15
@rujche rujche requested review from a team, Netyyyy, moarychan and saragluna as code owners December 5, 2025 06:15
@github-actions github-actions bot added the azure-spring All azure-spring related issues label Dec 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes two bugs related to the token-credential-bean-name property in Azure Spring Cloud autoconfiguration for Service Bus and Event Hubs.

Purpose: Resolves issues where multiple TokenCredential beans were being injected in Service Bus configuration, and where the spring.cloud.azure.eventhubs.credential.token-credential-bean-name property was not taking effect in Event Hubs configuration.

Key Changes:

  1. Added @Qualifier(DEFAULT_TOKEN_CREDENTIAL_BEAN_NAME) annotations to TokenCredential parameters in Service Bus and Event Hubs autoconfiguration classes to ensure the correct default credential bean is injected
  2. Added tokenCredentialResolver and defaultCredential setters to Event Hubs factory beans to enable custom token credential configuration
  3. Added comprehensive integration tests to verify the custom token credential configuration works correctly for both services

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
AzureServiceBusMessagingAutoConfiguration.java Added @Qualifier annotations to three factory bean methods to resolve the multiple TokenCredential beans issue
AzureEventHubsMessagingAutoConfiguration.java Added @Qualifier annotations and set tokenCredentialResolver/defaultCredential on factory beans to enable the token-credential-bean-name property
AzureServiceBusMessagingAutoConfigurationTests.java Added comprehensive test verifying custom token credential configuration and updated lambda expression to use method reference
AzureEventHubsMessagingAutoConfigurationTests.java Added comprehensive test verifying custom token credential configuration and updated lambda expression to use method reference

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

Labels

azure-spring All azure-spring related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants