You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The root EventHubClientBuilder used a type-based @ConditionalOnMissingBean, so when either DedicatedConsumerConnectionConfiguration or DedicatedProducerConnectionConfiguration activated, its named-but-EventHubClientBuilder-typed bean suppressed the root builder. The opposite section's SharedConsumer/SharedProducerConnectionConfiguration then satisfied its @ConditionalOnBean(EventHubClientBuilder.class) against the dedicated bean and injected it via type, so the shared client targeted the wrong event hub.
- Name the root builder springCloudAzureEventHubsClientBuilder and use @ConditionalOnMissingBean(name = ...) so dedicated builders no longer suppress it.
- Switch SharedConsumer/SharedProducerConnectionConfiguration to @ConditionalOnBean(name = ...) and inject EventHubClientBuilder via @qualifier(EVENT_HUB_CLIENT_BUILDER_BEAN_NAME).
- Add regression tests for asymmetric (one-side dedicated, one-side shared) configurations in both consumer and producer test classes.
Copy file name to clipboardExpand all lines: sdk/spring/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ This section includes changes in `spring-cloud-azure-autoconfigure` module.
13
13
14
14
#### Bugs Fixed
15
15
16
+
- Fixed Event Hubs autoconfiguration where a dedicated `EventHubClientBuilder` registered by `consumer`-only or `producer`-only sub-level overrides (`connection-string` / `namespace` / `event-hub-name`) suppressed the root builder and got injected into the opposite shared section, causing the shared client to target the other section's event hub. The root builder is now registered under bean name `springCloudAzureEventHubsClientBuilder` with a name-based `@ConditionalOnMissingBean`, and the shared consumer/producer sections gate on and inject that specific bean via `@Qualifier`. ([#49245](https://github.com/Azure/azure-sdk-for-java/issues/49245))
16
17
- Fixed JDBC/Azure Database and Redis passwordless connection scope defaulting using the wrong `azure.scopes` value for Azure China and Azure US Government when `spring.cloud.azure.profile.cloud-type` is set to `azure_china` or `azure_us_government`. The scopes are now correctly derived from the merged cloud type. ([#47096](https://github.com/Azure/azure-sdk-for-java/issues/47096))
Copy file name to clipboardExpand all lines: sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/context/AzureContextUtils.java
Copy file name to clipboardExpand all lines: sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsClientBuilderConfiguration.java
Copy file name to clipboardExpand all lines: sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsConsumerClientConfiguration.java
Copy file name to clipboardExpand all lines: sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsProducerClientConfiguration.java
Copy file name to clipboardExpand all lines: sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsConsumerClientConfigurationTests.java
Copy file name to clipboardExpand all lines: sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/AzureEventHubsProducerClientConfigurationTests.java
0 commit comments