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
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -253,6 +253,21 @@ public class MyClass {
253
253
The URI needs to use a virtual host name (that is, a service name, not a host name).
254
254
The `BlockingLoadBalancerClient` is used to create a full physical address.
255
255
256
+
In order to leverage additional capabilities that Spring Boot provides for `RestTemplateBuilder` (for example, observability support) you may want to use the autoconfigured
257
+
`RestTemplateBuilderConfigurer` while creating the `@LoadBalanced RestTemplateBuilder` beans:
IMPORTANT: To use it, add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project.
257
272
258
273
[[multiple-resttemplate-builder-beans]]
@@ -333,6 +348,22 @@ public class MyClass {
333
348
The URI needs to use a virtual host name (that is, a service name, not a host name).
334
349
The `BlockingLoadBalancerClient` is used to create a full physical address.
335
350
351
+
In order to leverage additional capabilities that Spring Boot provides for `RestClient.Builder` (for example, observability support) you may want to use the autoconfigured
352
+
`RestClientBuilderConfigurer` while creating the `@LoadBalanced RestClient.Builder` beans:
IMPORTANT: To use it, add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project.
337
368
338
369
[[multiple-restclient-objects]]
@@ -413,6 +444,24 @@ public class MyClass {
413
444
The URI needs to use a virtual host name (that is, a service name, not a host name).
414
445
The Spring Cloud LoadBalancer is used to create a full physical address.
415
446
447
+
In order to leverage additional capabilities that Spring Boot provides for `WebClient.Builder` (for example, observability support) you may want to use the autoconfigured
448
+
`WebClientCustomizer` beans while creating the `@LoadBalanced WebClient.Builder` beans:
449
+
450
+
[source,java,indent=0]
451
+
----
452
+
@Configuration
453
+
public class MyConfiguration {
454
+
455
+
@Bean
456
+
@LoadBalanced
457
+
public WebClient.Builder loadBalancedWebClientBuilder(ObjectProvider<WebClientCustomizer> customizerProvider) {
Copy file name to clipboardExpand all lines: spring-cloud-commons/src/test/java/org/springframework/cloud/client/loadbalancer/LoadBalancedRestClientIntegrationTests.java
0 commit comments