Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses load-balancing behavior in Spring Cloud Azure App Configuration refresh flows to ensure configuration and feature-flag refresh use consistent client selection and to avoid dropping replicas from the active rotation.
Changes:
- Adjusts
ConnectionManager#getNextActiveClientto rotate clients for round-robin load balancing instead of removing them from the active list. - Updates refresh logic to select clients consistently between configuration refresh checks and feature-flag refresh checks.
- Removes now-unused “current replica” tracking and updates tests and changelog accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManager.java | Changes load-balancing selection to round-robin rotation; removes unused replica tracking. |
| sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationReplicaClientFactory.java | Removes API used for tracking “current” replica client. |
| sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtil.java | Aligns refresh retry/client selection behavior for configuration vs feature-flag checks. |
| sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManagerTest.java | Updates expectations for new round-robin behavior. |
| sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java | Removes obsolete verification tied to removed “current client” API. |
| sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md | Adds a bug-fix entry describing the load-balancing/feature-flag refresh fix. |
...in/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManager.java
Outdated
Show resolved
Hide resolved
...ure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java
Show resolved
Hide resolved
...ava/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManagerTest.java
Outdated
Show resolved
Hide resolved
sdk/spring/spring-cloud-azure-appconfiguration-config/CHANGELOG.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...in/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManager.java
Outdated
Show resolved
Hide resolved
…/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManager.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
...ava/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManagerTest.java
Outdated
Show resolved
Hide resolved
...m/azure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtil.java
Show resolved
Hide resolved
…/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManagerTest.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
avanigupta
approved these changes
Feb 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/ConnectionManager.java:102
- In getNextActiveClient, the local variable name
clientsshadows the instance fieldclients, which makes the control flow harder to follow and easy to misread (especially since this method also mutatesactiveClients). Rename the local variable to something likeavailableClients(or similar) to avoid shadowing and improve readability.
if (useLastActive) {
List<AppConfigurationReplicaClient> clients = getAvailableClients();
for (AppConfigurationReplicaClient client: clients) {
if (client.getEndpoint().equals(lastActiveClient)) {
return client;
...ure/spring/cloud/appconfiguration/config/implementation/AppConfigurationRefreshUtilTest.java
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
currentReplicavariable. From the previous change toactiveClient.Note: A second PR will be created to randomize the active replica list for load balancing.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines