Skip to content

Commit c9fa3af

Browse files
committed
edits
1 parent a3eb229 commit c9fa3af

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

articles/java/spring-framework/app-configuration-support.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ In this example, if both the stores have the same configuration key, then the co
144144
145145
### Selecting configurations
146146

147-
The library loads configurations using their key and label. By default, the configurations that start with the key `/application/` are loaded. The default label is `\0`, which appears as `(No Label)` in the Azure portal. If a Spring profile is set, and no label is provided, then the default label is your Spring Profiles which is `${spring.profiles.active}`.
147+
The library loads configurations using their key and label. By default, the configurations that start with the key `/application/` are loaded. The default label is `\0`, which appears as `(No Label)` in the Azure portal. If a Spring profile is set, and no label is provided, then the default label is your Spring Profile, which is `${spring.profiles.active}`.
148148

149149
You can configure which configurations are loaded by selecting different key and label filters:
150150

@@ -172,7 +172,7 @@ The `label-filter` property supports the following filters:
172172
| `1.0.*` | Matches labels that start with `1.0.*`. |
173173
| `,1.0.0` | Matches labels `null` and `1.0.0`. Limited to five comma-separated values. |
174174

175-
If you're using YAML with label filters, and you want to load configuration with no label and more configurations with other labels you need to include an empty `,` for example `,dev` will match `\0` and `dev`, then the label filter needs to be surrounded by single quotes. This allows you to load configuration with no label first, followed by configurations with specific labels in the same filter:
175+
If you're using YAML with label filters, and you want to load configurations with no label and more configurations with other labels, you need to include an empty `,`. For example, `,dev` matches `\0` and `dev`. In this case, surround the label filter with single quotes. This value enables you to load configuration with no label first, followed by configurations with specific labels, in the same filter:
176176

177177
```yml
178178
spring:
@@ -186,9 +186,8 @@ spring:
186186
187187
> [!NOTE]
188188
> You can't combine `*` with `,` in filters. In that case, you need to use an additional select value.
189-
190-
> [!NOTE]
191-
> When using `*` in the label filter, and multiple configurations with the same key are loaded, they are loaded in alphabetical order, and the label last in alphabetical order is used.
189+
>
190+
> When you use `*` in the label filter, and multiple configurations with the same key are loaded, they're loaded in alphabetical order, and the label last in alphabetical order is used.
192191

193192
### Spring Profiles
194193

@@ -201,7 +200,7 @@ spring.cloud.azure.appconfiguration.stores[0].selects[1].label-filter=${spring.p
201200

202201
In the first `label-filter`, the library first loads all configurations with the `\0` label, followed by all configurations matching the Spring Profiles. Spring Profiles have priority over the `\0` configurations, because they're at the end.
203202

204-
In the second `label-filter`, the string `_local` is appended to the end of the Spring Profiles, though only to the last Spring Profile if there is more than one.
203+
In the second `label-filter`, the string `_local` is appended to the end of the Spring Profiles, though only to the last Spring Profile if there's more than one.
205204

206205
### Disabled stores
207206

@@ -221,7 +220,7 @@ Authentication through connection string is the simplest form to set up, though
221220
az appconfig credential list --name <name-of-your-store>
222221
```
223222

224-
You can then set the `spring.cloud.azure.appconfiguration.stores[0].connection-string` property to the connection string. When using this approach, it's highly recommend to set the connection string in the local configuration file to a placeholder value that maps to an environment variable. This approach enables you to avoid adding the connection string to source control.
223+
You can then set the `spring.cloud.azure.appconfiguration.stores[0].connection-string` property to the connection string. When using this approach, we highly recommend setting the connection string in the local configuration file to a placeholder value that maps to an environment variable. This approach enables you to avoid adding the connection string to source control.
225224

226225
### Spring Cloud Azure configuration
227226

@@ -255,13 +254,13 @@ Each replica you create has a dedicated endpoint. If your application resides in
255254

256255
By default, the library auto discovers all replicas that exist for a configuration store. When a request is made to the provided store and fails, the library automatically retries the request against the available replicas.
257256

258-
The failover may occur if the library observes any of the following conditions:
257+
The failover might occur if the library observes any of the following conditions:
259258

260259
- Receives responses with service unavailable status code (HTTP 500 or above) from an endpoint.
261260
- Experiences network connectivity issues.
262261
- Requests are throttled (HTTP status code 429).
263262

264-
Once the provided store comes back online, the library automatically retries the request against the provided store.
263+
After the provided store comes back online, the library automatically retries the request against the provided store.
265264

266265
If you want to control the failover behavior, you can manually provide a list of stores to use for failover.
267266

@@ -279,7 +278,7 @@ spring.cloud.azure.appconfiguration.stores[0].connection-strings[1]=[your replic
279278

280279
If all provided replica endpoints fail, the library attempts to connect to auto discovered replicas of the primary store.
281280

282-
Replication can be disabled with the setting `spring.cloud.azure.appconfiguration.stores[0].replica-discovery-enabled=false`.
281+
You can disable replication with the setting `spring.cloud.azure.appconfiguration.stores[0].replica-discovery-enabled=false`.
283282

284283
### Creating a configuration store with geo-replication
285284

@@ -357,11 +356,11 @@ You can create any secret-identifier through the Azure CLI. Secret identifiers j
357356

358357
You can use [Spring Cloud Azure configuration](configuration.md) to configure the library. You can use the same credential used to connect to App Configuration to connect to Azure Key Vault.
359358

360-
In addition, you can create a `SecretClientCustomizer` the same way as you would create a `ConfigurationClientCustomizer` to provide your own authentication method.
359+
You can also create a `SecretClientCustomizer` the same way as you would create a `ConfigurationClientCustomizer` to provide your own authentication method.
361360

362361
#### Resolve non-Key Vault secrets
363362

364-
The App Configuration library provides a method to override the resolution of key vault references. For example, it can be used to locally resolve secrets in a dev environment. This resolution is done through the `KeyVaultSecretProvider`. The `KeyVaultSecretProvider` if provided is called on every key vault reference. If `getSecret` returns a non-null value, it is used as the secret value. Otherwise, the Key Vault Reference is resolved normally.
363+
The App Configuration library provides a method to override the resolution of key vault references. For example, you can use it to locally resolve secrets in a dev environment. This resolution is done through the `KeyVaultSecretProvider`. The `KeyVaultSecretProvider`, if provided, is called on every key vault reference. If `getSecret` returns a non-null value, it's used as the secret value. Otherwise, the Key Vault Reference is resolved normally.
365364

366365
```java
367366
public class MySecretProvider implements KeyVaultSecretProvider {
@@ -404,7 +403,7 @@ spring.cloud.azure.appconfiguration.stores[0].feature-flags.selects[0].label-fil
404403

405404
#### Feature flags
406405

407-
Feature flags are composed of multiple parts including; a name and a list of feature-filters that are used to turn on the feature. Feature flags can either have a boolean state of on/off, or they can have a list of feature filters. Feature flags evaluate feature filters until one returns `true`. If no feature filter returns `true`, then the feature flag returns `false`.
406+
Feature flags are composed of multiple parts including a name and a list of feature-filters that are used to turn on the feature. Feature flags can either have a boolean state of on or off, or they can have a list of feature filters. Feature flags evaluate feature filters until one returns `true`. If no feature filter returns `true`, then the feature flag returns `false`.
408407

409408
#### Feature filters
410409

@@ -473,7 +472,7 @@ if (featureManager.isEnabled("feature-t")) {
473472
> [!NOTE]
474473
> `FeatureManager` also has an asynchronous version of `isEnabled` called `isEnabledAsync`.
475474

476-
Without feature management configuration or when the feature flag does not exist, `isEnabled` always returns `false`. If an existing feature flag is configured with an unknown feature filter, then a `FilterNotFoundException` is thrown. You can change this behavior to return `false` by configuring `fail-fast` to `false`. The following table describes `fail-fast`:
475+
Without feature management configuration or when the feature flag doesn't exist, `isEnabled` always returns `false`. If an existing feature flag is configured with an unknown feature filter, then a `FilterNotFoundException` is thrown. You can change this behavior to return `false` by configuring `fail-fast` to `false`. The following table describes `fail-fast`:
477476

478477
| Name | Description | Required | Default |
479478
|---------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|----------|---------|
@@ -515,7 +514,7 @@ public class MyDisabledFeaturesHandler implements DisabledFeaturesHandler {
515514

516515
##### Routing
517516

518-
Certain routes may expose application capabilities that are gated by features. If a feature is disabled, you can redirect these routes to another endpoint, as shown in the following example:
517+
Certain routes might expose application capabilities that are gated by features. If a feature is disabled, you can redirect these routes to another endpoint, as shown in the following example:
519518

520519
```java
521520
@GetMapping("/featureT")
@@ -542,7 +541,7 @@ This filter always returns `true`. For a usage example, see the [feature flag de
542541

543542
#### PercentageFilter
544543

545-
Each time it is checked, the evaluation of `PercentageFilter` can return a different result. You can circumvent this inconsistency by using the `FeatureManagementSnapshot`, which caches the result of the feature flag per request.
544+
Each time it's checked, the evaluation of `PercentageFilter` can return a different result. You can circumvent this inconsistency by using the `FeatureManagementSnapshot`, which caches the result of the feature flag per request.
546545

547546
```yaml
548547
feature-management:
@@ -571,7 +570,7 @@ feature-management:
571570
End: "Mon, 01 July 2019 00:00:00 GMT"
572571
```
573572

574-
This filter also, supports recurring time window filters. It supports both daily and weekly recurrences, along with an expiration time.
573+
This filter also supports recurring time window filters. It supports both daily and weekly recurrences, along with an expiration time.
575574

576575
```yaml
577576
feature-management:
@@ -593,7 +592,7 @@ feature-management:
593592
- Wednesday
594593
```
595594

596-
This recurrence pattern happens every week on Monday and Wednesday. From 00:00:00 GMT to 12:00:00 GMT and will never expire.
595+
This recurrence pattern happens every week on Monday and Wednesday from 00:00:00 GMT to 12:00:00 GMT and doesn't expire.
597596

598597
```yaml
599598
feature-management:
@@ -664,7 +663,7 @@ public class Random implements FeatureFilter {
664663

665664
#### Parameterized feature filters
666665

667-
Some feature filters require parameters to determine whether a feature should be turned on. For example, a browser feature filter may turn on a feature for a certain set of browsers. You might want a feature enabled for Microsoft Edge and Chrome browsers, but not Firefox. To set up this situation, you can design a feature filter to expect parameters. These parameters would be specified in the feature configuration and in code, and would be accessible via the `FeatureFilterEvaluationContext` parameter of `evaluate`. `FeatureFilterEvaluationContext` has a property `parameters`, which is a `Map<String, Object>`.
666+
Some feature filters require parameters to determine whether a feature should be turned on. For example, a browser feature filter might turn on a feature for a certain set of browsers. You might want a feature enabled for Microsoft Edge and Chrome browsers, but not Firefox. To set up this situation, you can design a feature filter to expect parameters. These parameters would be specified in the feature configuration and in code, and would be accessible via the `FeatureFilterEvaluationContext` parameter of `evaluate`. `FeatureFilterEvaluationContext` has a property `parameters`, which is a `Map<String, Object>`.
668667

669668
### Targeting
670669

@@ -716,7 +715,7 @@ Options are available to customize how targeting evaluation is performed across
716715

717716
Enabling config refresh for your configurations lets you pull their latest values from your App Configuration store or stores without having to restart the application.
718717

719-
To enable refresh, you need to enable monitoring along with monitoring triggers. A monitoring trigger is a key with an optional label which the system monitors for value changes to trigger updates. The value of the monitoring trigger can be any value, as long as it changes when a refresh is needed.
718+
To enable refresh, you need to enable monitoring along with monitoring triggers. A monitoring trigger is a key with an optional label that the system monitors for value changes to trigger updates. The value of the monitoring trigger can be any value, as long as it changes when a refresh is needed.
720719

721720
> [!NOTE]
722721
> Any operation that changes the ETag of a monitoring trigger causes a refresh, such as a content-type change.
@@ -747,7 +746,7 @@ After the application generates the log, it refreshes all `@Bean`s in the refres
747746

748747
### Pull-based refresh
749748

750-
The App Configuration Spring libraries support the ability to periodically check on a refresh interval for changes made to the monitoring triggers. By default, the refresh interval is set to 30 seconds. After the refresh interval has passed, when a refresh attempt is made, all triggers are checked in the given store for changes. Any change to the key causes a refresh to trigger. Because the libraries integrate with the Spring refresh system, any refresh reloads all configurations from all stores. You can set the refresh interval to any interval longer than 1 second. The supported units for the refresh interval are `s`, `m`, `h`, and `d` for seconds, minutes, hours, and days respectively. The following example sets the refresh interval to 5 minutes:
749+
The App Configuration Spring libraries support the ability to periodically check on a refresh interval for changes made to the monitoring triggers. By default, the refresh interval is set to 30 seconds. After the refresh interval passes, when a refresh attempt is made, all triggers are checked in the given store for changes. Any change to the key causes a refresh to trigger. Because the libraries integrate with the Spring refresh system, any refresh reloads all configurations from all stores. You can set the refresh interval to any interval longer than 1 second. The supported units for the refresh interval are `s`, `m`, `h`, and `d` for seconds, minutes, hours, and days respectively. The following example sets the refresh interval to 5 minutes:
751750

752751
```properties
753752
spring.cloud.azure.appconfiguration.stores[0].monitoring.refresh-interval= 5m

0 commit comments

Comments
 (0)