Skip to content

Commit d1f2f9c

Browse files
committed
Revise documents
Signed-off-by: Yanming Zhou <[email protected]>
1 parent 7e1cbf8 commit d1f2f9c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

docs/modules/ROOT/pages/spring-cloud-commons/application-context-services.adoc

+10-10
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ If you build an application context from `SpringApplication` or `SpringApplicati
4141
It is a feature of Spring that child contexts inherit property sources and profiles from their parent, so the "`main`" application context contains additional property sources, compared to building the same context without Spring Cloud Config.
4242
The additional property sources are:
4343

44-
* "`bootstrap`": If any `PropertySourceLocators` are found in the bootstrap context and if they have non-empty properties, an optional `CompositePropertySource` appears with high priority.
44+
* "`bootstrap`": If any `PropertySourceLocator` are found in the bootstrap context and if they have non-empty properties, an optional `CompositePropertySource` appears with high priority.
4545
An example would be properties from the Spring Cloud Config Server.
4646
See "`xref:spring-cloud-commons/application-context-services.adoc#customizing-bootstrap-property-sources[Customizing the Bootstrap Property Sources]`" for how to customize the contents of this property source.
4747

48-
NOTE: Prior to Spring Cloud 2022.0.3 `PropertySourceLocators` (including the ones for Spring Cloud Config) were run during
49-
the main application context and not in the Bootstrap context. You can force `PropertySourceLocators` to be run during the
48+
NOTE: Prior to Spring Cloud 2022.0.3 `PropertySourceLocator`s (including the ones for Spring Cloud Config) were run during
49+
the main application context and not in the Bootstrap context. You can force `PropertySourceLocator`s to be run during the
5050
Bootstrap context by setting `spring.cloud.config.initialize-on-context-refresh=true` in `bootstrap.[properties | yaml]`.
5151

5252
* "`applicationConfig: [classpath:bootstrap.yml]`" (and related files if Spring profiles are active): If you have a `bootstrap.yml` (or `.properties`), those properties are used to configure the bootstrap context.
@@ -96,15 +96,15 @@ Once that flag is set, two finer-grained settings control the location of the re
9696
The bootstrap context can be set to do anything you like by adding entries to `/META-INF/spring.factories` under a key named `org.springframework.cloud.bootstrap.BootstrapConfiguration`.
9797
This holds a comma-separated list of Spring `@Configuration` classes that are used to create the context.
9898
Any beans that you want to be available to the main application context for autowiring can be created here.
99-
There is a special contract for `@Beans` of type `ApplicationContextInitializer`.
99+
There is a special contract for `@Bean`s of type `ApplicationContextInitializer`.
100100
If you want to control the startup sequence, you can mark classes with the `@Order` annotation (the default order is `last`).
101101

102102
WARNING: When adding custom `BootstrapConfiguration`, be careful that the classes you add are not `@ComponentScanned` by mistake into your "`main`" application context, where they might not be needed.
103103
Use a separate package name for boot configuration classes and make sure that name is not already covered by your `@ComponentScan` or `@SpringBootApplication` annotated configuration classes.
104104

105105
The bootstrap process ends by injecting initializers into the main `SpringApplication` instance (which is the normal Spring Boot startup sequence, whether it runs as a standalone application or is deployed in an application server).
106106
First, a bootstrap context is created from the classes found in `spring.factories`.
107-
Then, all `@Beans` of type `ApplicationContextInitializer` are added to the main `SpringApplication` before it is started.
107+
Then, all `@Bean`s of type `ApplicationContextInitializer` are added to the main `SpringApplication` before it is started.
108108

109109
[[customizing-bootstrap-property-sources]]
110110
== Customizing the Bootstrap Property Sources
@@ -138,10 +138,10 @@ If you create a jar with this class in it and then add a `META-INF/spring.factor
138138
org.springframework.cloud.bootstrap.BootstrapConfiguration=sample.custom.CustomPropertySourceLocator
139139
----
140140

141-
As of Spring Cloud 2022.0.3, Spring Cloud will now call `PropertySourceLocators` twice. The first fetch
141+
As of Spring Cloud 2022.0.3, Spring Cloud will now call `PropertySourceLocator`s twice. The first fetch
142142
will retrieve any property sources without any profiles. These property sources will have the opportunity to
143-
activate profiles using `spring.profiles.active`. After the main application context starts `PropertySourceLocators`
144-
will be called a second time, this time with any active profiles allowing `PropertySourceLocators` to locate
143+
activate profiles using `spring.profiles.active`. After the main application context starts `PropertySourceLocator`s
144+
will be called a second time, this time with any active profiles allowing `PropertySourceLocator`s to locate
145145
any additional `PropertySources` with profiles.
146146

147147
[[logging-configuration]]
@@ -155,7 +155,7 @@ For example, using `custom.loggin.logpath` is not recognized by Spring Cloud whe
155155
[[environment-changes]]
156156
== Environment Changes
157157

158-
The application listens for an `EnvironmentChangeEvent` and reacts to the change in a couple of standard ways (additional `ApplicationListeners` can be added as `@Beans` in the normal way).
158+
The application listens for an `EnvironmentChangeEvent` and reacts to the change in a couple of standard ways (additional `ApplicationListener`s can be added as `@Bean`s in the normal way).
159159
When an `EnvironmentChangeEvent` is observed, it has a list of key values that have changed, and the application uses those to:
160160

161161
* Re-bind any `@ConfigurationProperties` beans in the context.
@@ -209,7 +209,7 @@ management:
209209
----
210210

211211
NOTE: `@RefreshScope` works (technically) on a `@Configuration` class, but it might lead to surprising behavior.
212-
For example, it does not mean that all the `@Beans` defined in that class are themselves in `@RefreshScope`.
212+
For example, it does not mean that all the `@Bean`s defined in that class are themselves in `@RefreshScope`.
213213
Specifically, anything that depends on those beans cannot rely on them being updated when a refresh is initiated, unless it is itself in `@RefreshScope`.
214214
In that case, it is rebuilt on a refresh and its dependencies are re-injected.
215215
At that point, they are re-initialized from the refreshed `@Configuration`).

docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ For the reactive implementation, you can additionally set:
537537

538538
For the reactive implementation, you can also implement your own `LoadBalancerRetryPolicy` to have more detailed control over the load-balanced call retries.
539539

540-
For both implementations, you can also set the exceptions that trigger the replies by adding a list of values under the `spring.cloud.loadbalancer.[serviceId].retry.retryable-exceptions` property. If you do, we make sure to add `RetryableStatusCodeExceptions` to the list of exceptions provided by you, so that we also retry on retryable status codes. If you do not specify any exceptions via properties, the exceptions we use by default are `IOException`, `TimeoutException` and `RetryableStatusCodeException`. You can also enable retrying on all exceptions by setting `spring.cloud.loadbalancer.[serviceId].retry.retry-on-all-exceptions` to `true`.
540+
For both implementations, you can also set the exceptions that trigger the replies by adding a list of values under the `spring.cloud.loadbalancer.[serviceId].retry.retryable-exceptions` property. If you do, we make sure to add `RetryableStatusCodeException`s to the list of exceptions provided by you, so that we also retry on retryable status codes. If you do not specify any exceptions via properties, the exceptions we use by default are `IOException`, `TimeoutException` and `RetryableStatusCodeException`. You can also enable retrying on all exceptions by setting `spring.cloud.loadbalancer.[serviceId].retry.retry-on-all-exceptions` to `true`.
541541

542542
WARNING: If you use the blocking implementation with Spring Retries, if you want to keep the behaviour from previous releases, set `spring.cloud.loadbalancer.[serviceId].retry.retry-on-all-exceptions` to `true` as that used to be the default mode for the blocking implementation.
543543

docs/modules/ROOT/pages/spring-cloud-commons/loadbalancer.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ NOTE: For some implementations, such as `BlockingLoadBalancerClient`, request an
516516

517517
NOTE: The meters are registered in the registry when at least one record is added for a given meter.
518518

519-
TIP: You can further configure the behavior of those metrics (for example, add https://micrometer.io/docs/concepts#_histograms_and_percentiles[publishing percentiles and histograms]) by https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-per-meter-properties[adding `MeterFilters`].
519+
TIP: You can further configure the behavior of those metrics (for example, add https://micrometer.io/docs/concepts#_histograms_and_percentiles[publishing percentiles and histograms]) by https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-metrics-per-meter-properties[adding `MeterFilter`s].
520520

521521
[[configuring-individual-loadbalancerclients]]
522522
== Configuring Individual LoadBalancerClients

0 commit comments

Comments
 (0)