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/common-abstractions.adoc
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ Please see the documentation of the `ServiceRegistry` implementation you use for
135
135
For instance, Eureka's supported statuses are `UP`, `DOWN`, `OUT_OF_SERVICE`, and `UNKNOWN`.
136
136
137
137
[[rest-template-loadbalancer-client]]
138
-
== Spring `RestTemplate` as a LoadBalancer Client
138
+
== Spring RestTemplate as a LoadBalancer Client
139
139
140
140
You can configure a `RestTemplate` to use a Load-balancer client.
141
141
To create a load-balanced `RestTemplate`, create a `RestTemplate` `@Bean` and use the `@LoadBalanced` qualifier, as the following example shows:
@@ -173,7 +173,7 @@ IMPORTANT: To use a load-balanced `RestTemplate`, you need to have a Spring Clou
173
173
Add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project in order to use it.
174
174
175
175
[[multiple-resttemplate-objects]]
176
-
=== Multiple `RestTemplate` Objects
176
+
=== Multiple RestTemplate Objects
177
177
178
178
If you want a `RestTemplate` that is not load-balanced, create a `RestTemplate` bean and inject it.
179
179
To access the load-balanced `RestTemplate`, use the `@LoadBalanced` qualifier when you create your `@Bean`, as the following example shows:
@@ -219,7 +219,7 @@ IMPORTANT: Notice the use of the `@Primary` annotation on the plain `RestTemplat
219
219
TIP: If you see errors such as `java.lang.IllegalArgumentException: Can not set org.springframework.web.client.RestTemplate field com.my.app.Foo.restTemplate to com.sun.proxy.$Proxy89`, try injecting `RestOperations` or setting `spring.aop.proxyTargetClass=true`.
220
220
221
221
[[rest-client-loadbalancer-client]]
222
-
== Spring `RestClient` as a LoadBalancer Client
222
+
== Spring RestClient as a LoadBalancer Client
223
223
224
224
You can configure a `RestClient` to use a Load-balancer client.
225
225
To create a load-balanced `RestClient`, create a `RestClient.Builder` `@Bean` and use the `@LoadBalanced` qualifier, as the following example shows:
@@ -250,8 +250,7 @@ public class MyClass {
250
250
The URI needs to use a virtual host name (that is, a service name, not a host name).
251
251
The `BlockingLoadBalancerClient` is used to create a full physical address.
252
252
253
-
IMPORTANT: To use a load-balanced `RestClient`, you need to have a Spring LoadBalancer implementation in your classpath.
254
-
Add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project in order to use it.
253
+
IMPORTANT: To use it, add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project.
255
254
256
255
[[multiple-restclient-objects]]
257
256
=== Multiple `RestClient.Builder` Objects
@@ -300,7 +299,7 @@ public class MyClass {
300
299
IMPORTANT: Notice the use of the `@Primary` annotation on the plain `RestTemplate` declaration in the preceding example to disambiguate the unqualified `@Autowired` injection.
301
300
302
301
[[webclinet-loadbalancer-client]]
303
-
== Spring `WebClient` as a LoadBalancer Client
302
+
== Spring WebClient as a LoadBalancer Client
304
303
305
304
You can configure `WebClient` to automatically use a load-balancer client.
306
305
To create a load-balanced `WebClient`, create a `WebClient.Builder` `@Bean` and use the `@LoadBalanced` qualifier, as follows:
Copy file name to clipboardExpand all lines: docs/modules/ROOT/pages/spring-cloud-commons/loadbalancer.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ NOTE: The classes you pass as `@LoadBalancerClient` or `@LoadBalancerClients` co
44
44
[[spring-cloud-loadbalancer-integrations]]
45
45
== Spring Cloud LoadBalancer integrations
46
46
47
-
In order to make it easy to use Spring Cloud LoadBalancer, we provide `ReactorLoadBalancerExchangeFilterFunction` that can be used with `WebClient` and `BlockingLoadBalancerClient` that works with `RestTemplate` and `RestClient`.
47
+
To make it easy to use Spring Cloud LoadBalancer, we provide `ReactorLoadBalancerExchangeFilterFunction` (which can be used with `WebClient`) and `BlockingLoadBalancerClient` (which works with `RestTemplate` and `RestClient`).
48
48
You can see more information and examples of usage in the following sections:
49
49
50
50
* xref:spring-cloud-commons/common-abstractions.adoc#rest-template-loadbalancer-client[Spring `RestTemplate` as a LoadBalancer Client]
Copy file name to clipboardExpand all lines: docs/modules/ROOT/partials/_configprops.adoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,8 @@
69
69
|spring.cloud.loadbalancer.stats.micrometer.enabled | `+++false+++` | Enables Spring Cloud LoadBalancer Micrometer stats.
70
70
|spring.cloud.loadbalancer.sticky-session.add-service-instance-cookie | `+++false+++` | Indicates whether a cookie with the newly selected instance should be added by LoadBalancer.
71
71
|spring.cloud.loadbalancer.sticky-session.instance-id-cookie-name | `+++sc-lb-instance-id+++` | The name of the cookie holding the preferred instance id.
72
+
|spring.cloud.loadbalancer.subset.instance-id | | Instance id of deterministic subsetting. If not set, {@link IdUtils#getDefaultInstanceId(PropertyResolver)} will be used.
73
+
|spring.cloud.loadbalancer.subset.size | `+++100+++` | Max subset size of deterministic subsetting.
72
74
|spring.cloud.loadbalancer.x-forwarded.enabled | `+++false+++` | To Enable X-Forwarded Headers.
73
75
|spring.cloud.loadbalancer.zone | | Spring Cloud LoadBalancer zone.
74
76
|spring.cloud.refresh.additional-property-sources-to-retain | | Additional property sources to retain during a refresh. Typically only system property sources are retained. This property allows property sources, such as property sources created by EnvironmentPostProcessors to be retained as well.
0 commit comments