Skip to content

Fixed the Service Bus sub-client builders overwriting configuration already set on the underlying ServiceBusClientBuilder#49777

Open
moarychan wants to merge 23 commits into
mainfrom
v-shilichen/fix-srcbus-sub-client-override-parent-client-options
Open

Fixed the Service Bus sub-client builders overwriting configuration already set on the underlying ServiceBusClientBuilder#49777
moarychan wants to merge 23 commits into
mainfrom
v-shilichen/fix-srcbus-sub-client-override-parent-client-options

Conversation

@moarychan

@moarychan moarychan commented Jul 10, 2026

Copy link
Copy Markdown
Member

Description

Fixes #49742

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.

@github-actions github-actions Bot added the azure-spring All azure-spring related issues label Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request addresses #49742 by ensuring Service Bus processor (and other sub-client) creation can preserve ServiceBusClientBuilder configuration applied via AzureServiceClientBuilderCustomizer (notably ClientOptions/TracingOptions) instead of having it overwritten during sub-client builder configuration.

Changes:

  • Introduces a new inherit-configuration property (nullable, treated as true by default) and propagates it through Service Bus namespace/producer/consumer/processor property models and mergers.
  • Updates Service Bus sub-client builder factory behavior to optionally skip re-applying property-derived configuration to the underlying ServiceBusClientBuilder, preventing customizer configuration from being overwritten.
  • Aligns listener container factory bean name constants/usages and adds unit tests for the new inheritance behavior.

Reviewed changes

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

Show a summary per file
File Description
sdk/spring/spring-messaging-azure/src/main/java/com/azure/spring/messaging/implementation/config/AzureListenerEndpoint.java Fixes minor grammar in interface JavaDoc.
sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/ProcessorPropertiesParentMergerTests.java Adds coverage for inheritConfiguration precedence (parent vs child).
sdk/spring/spring-messaging-azure-servicebus/src/test/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/ConsumerPropertiesParentMergerTests.java Adds coverage for inheritConfiguration precedence (parent vs child).
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/SenderPropertiesParentMerger.java Propagates inheritConfiguration from parent/child into merged producer properties.
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/ProcessorPropertiesParentMerger.java Propagates inheritConfiguration from namespace parent into processor properties.
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/ProcessorPropertiesMerger.java Includes inheritConfiguration in processor property copying logic.
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/properties/merger/ConsumerPropertiesParentMerger.java Propagates inheritConfiguration into merged consumer properties and copy helper.
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListenerAnnotationBeanPostProcessor.java Exposes default container factory bean name constant publicly for reuse.
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/implementation/core/annotation/ServiceBusListener.java Fixes documented default container factory bean name to match actual default.
sdk/spring/spring-messaging-azure-servicebus/src/main/java/com/azure/spring/messaging/servicebus/core/properties/CommonProperties.java Adds inheritConfiguration property to common Service Bus properties.
sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListenerAnnotationBeanPostProcessor.java Exposes default container factory bean name constant publicly for reuse.
sdk/spring/spring-messaging-azure-eventhubs/src/main/java/com/azure/spring/messaging/eventhubs/implementation/core/annotation/EventHubsListener.java Fixes documented default container factory bean name to match actual default.
sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonTestProperties.java Adds inheritConfiguration to test properties used by factory tests.
sdk/spring/spring-cloud-azure-service/src/test/java/com/azure/spring/cloud/service/implementation/servicebus/factory/AbstractServiceBusSubClientBuilderFactoryTests.java Adds tests ensuring inheritConfiguration=false prevents overwriting shared builder config.
sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/properties/ServiceBusClientCommonProperties.java Adds new getInheritConfiguration() contract and documents null-as-true behavior.
sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/lifecycle/ServiceBusProcessorClientLifecycleManager.java Fixes a minor grammar issue in class JavaDoc.
sdk/spring/spring-cloud-azure-service/src/main/java/com/azure/spring/cloud/service/implementation/servicebus/factory/AbstractServiceBusSubClientBuilderFactory.java Implements inheritance gating to prevent property-derived overwrites of ServiceBusClientBuilder config.
sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusPropertiesTest.java Adds tests for default null and inheritance/override behavior in autoconfig properties.
sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusProperties.java Propagates inheritConfiguration into built producer/consumer/processor property objects.
sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusCommonProperties.java Adds namespace-level inheritConfiguration property to autoconfig model.
sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/messaging/AzureMessagingListenerAutoConfiguration.java Reuses exposed constants for container factory bean naming to avoid string duplication.
sdk/spring/CHANGELOG.md Documents the new inherit-configuration property and its intended effect.

moarychan and others added 2 commits July 10, 2026 14:24
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@moarychan moarychan marked this pull request as ready for review July 10, 2026 06:25
@moarychan moarychan requested review from a team, Netyyyy, rujche and saragluna as code owners July 10, 2026 06:25
@rujche rujche requested a review from Copilot July 10, 2026 06:27
@rujche rujche moved this to In Progress in Spring Cloud Azure Jul 10, 2026
@rujche rujche added this to the 2026-08 milestone Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread sdk/spring/CHANGELOG.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: moarychan <19926623+moarychan@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

moarychan and others added 2 commits July 13, 2026 14:43
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@moarychan moarychan requested review from Copilot and removed request for Netyyyy July 13, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

moarychan and others added 2 commits July 13, 2026 15:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

@moarychan moarychan marked this pull request as draft July 13, 2026 07:46
@moarychan moarychan requested a review from Copilot July 13, 2026 07:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

moarychan and others added 2 commits July 13, 2026 16:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@moarychan moarychan marked this pull request as ready for review July 13, 2026 08:25
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

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[BUG] spring-cloud-azure: customizer-set ClientOptions (incl. TracingOptions) silently overwritten for Service Bus processors

4 participants