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
Copy file name to clipboardexpand all lines: docs/modules/ROOT/pages/spring-cloud-commons/application-context-services.adoc
+10-10
Original file line number
Diff line number
Diff line change
@@ -41,12 +41,12 @@ If you build an application context from `SpringApplication` or `SpringApplicati
41
41
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.
42
42
The additional property sources are:
43
43
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.
45
45
An example would be properties from the Spring Cloud Config Server.
46
46
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.
47
47
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
50
50
Bootstrap context by setting `spring.cloud.config.initialize-on-context-refresh=true` in `bootstrap.[properties | yaml]`.
51
51
52
52
* "`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
96
96
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`.
97
97
This holds a comma-separated list of Spring `@Configuration` classes that are used to create the context.
98
98
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`.
100
100
If you want to control the startup sequence, you can mark classes with the `@Order` annotation (the default order is `last`).
101
101
102
102
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.
103
103
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.
104
104
105
105
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).
106
106
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.
108
108
109
109
[[customizing-bootstrap-property-sources]]
110
110
== 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
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
142
142
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
145
145
any additional `PropertySources` with profiles.
146
146
147
147
[[logging-configuration]]
@@ -155,7 +155,7 @@ For example, using `custom.loggin.logpath` is not recognized by Spring Cloud whe
155
155
[[environment-changes]]
156
156
== Environment Changes
157
157
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).
159
159
When an `EnvironmentChangeEvent` is observed, it has a list of key values that have changed, and the application uses those to:
160
160
161
161
* Re-bind any `@ConfigurationProperties` beans in the context.
@@ -209,7 +209,7 @@ management:
209
209
----
210
210
211
211
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`.
213
213
Specifically, anything that depends on those beans cannot rely on them being updated when a refresh is initiated, unless it is itself in `@RefreshScope`.
214
214
In that case, it is rebuilt on a refresh and its dependencies are re-injected.
215
215
At that point, they are re-initialized from the refreshed `@Configuration`).
Copy file name to clipboardexpand all lines: docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -537,7 +537,7 @@ For the reactive implementation, you can additionally set:
537
537
538
538
For the reactive implementation, you can also implement your own `LoadBalancerRetryPolicy` to have more detailed control over the load-balanced call retries.
539
539
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`.
541
541
542
542
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.
Copy file name to clipboardexpand all lines: docs/modules/ROOT/pages/spring-cloud-commons/loadbalancer.adoc
+1-1
Original file line number
Diff line number
Diff line change
@@ -516,7 +516,7 @@ NOTE: For some implementations, such as `BlockingLoadBalancerClient`, request an
516
516
517
517
NOTE: The meters are registered in the registry when at least one record is added for a given meter.
518
518
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].
0 commit comments