Skip to content

Commit 680464f

Browse files
authored
Merge pull request #106775 from mrm9084/AppConfigFeatureManagementFix
Fixing Async Versioning and blocking code
2 parents a9f1544 + dbdba48 commit 680464f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

articles/azure-app-configuration/quickstart-feature-flag-spring-boot.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ Use the [Spring Initializr](https://start.spring.io/) to create a new Spring Boo
165165

166166
@Controller
167167
@ConfigurationProperties("controller")
168-
169168
public class HelloController {
170169

171170
private FeatureManager featureManager;
@@ -176,7 +175,7 @@ Use the [Spring Initializr](https://start.spring.io/) to create a new Spring Boo
176175

177176
@GetMapping("/welcome")
178177
public String mainWithParam(Model model) {
179-
model.addAttribute("Beta", featureManager.isEnabledAsync("Beta"));
178+
model.addAttribute("Beta", featureManager.isEnabledAsync("Beta").block());
180179
return "welcome";
181180
}
182181
}

articles/azure-app-configuration/use-feature-flags-spring-boot.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ The easiest way to connect your Spring Boot application to App Configuration is
5555
<dependency>
5656
<groupId>com.microsoft.azure</groupId>
5757
<artifactId>spring-cloud-azure-feature-management-web</artifactId>
58-
<version>1.1.1</version>
58+
<version>1.1.2</version>
5959
</dependency>
6060
```
6161

@@ -65,7 +65,7 @@ The easiest way to connect your Spring Boot application to App Configuration is
6565
<dependency>
6666
<groupId>com.microsoft.azure</groupId>
6767
<artifactId>spring-cloud-azure-feature-management-web</artifactId>
68-
<version>1.2.1</version>
68+
<version>1.2.2</version>
6969
</dependency>
7070
```
7171

@@ -103,8 +103,7 @@ The basic pattern of feature management is to first check if a feature flag is s
103103
```java
104104
private FeatureManager featureManager;
105105
...
106-
if (featureManager.isEnabledAsync("feature-a"))
107-
{
106+
if (featureManager.isEnabledAsync("feature-a").block()) {
108107
// Run the following code
109108
}
110109
```
@@ -153,7 +152,7 @@ public class FeatureFlagFilter implements Filter {
153152
@Override
154153
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
155154
throws IOException, ServletException {
156-
if(!featureManager.isEnabled("feature-a")) {
155+
if(!featureManager.isEnabledAsync("feature-a").block()) {
157156
chain.doFilter(request, response);
158157
return;
159158
}

0 commit comments

Comments
 (0)