From c09f36d1c727c2127a1e39272a570e1af4418ba3 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Wed, 9 Oct 2024 18:04:08 +0200 Subject: [PATCH 1/3] Fix GH actions setup. --- .github/workflows/maven.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index bb92bc17..7979a5c5 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -5,9 +5,9 @@ name: Build on: push: - branches: [ main, 4.0.x, 3.1.x ] + branches: [ main, 4.1.x ] pull_request: - branches: [ main, 4.0.x, 3.1.x ] + branches: [ main, 4.1.x ] jobs: build: From d1d552f1237d28e20ce4f8a73ea4d3892fc41a17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:30:45 +0200 Subject: [PATCH 2/3] Bump @antora/collector-extension in /docs (#1406) --- updated-dependencies: - dependency-name: "@antora/collector-extension" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/package.json b/docs/package.json index 78c6f3c4..1c8155de 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,7 +2,7 @@ "dependencies": { "antora": "3.2.0-alpha.6", "@antora/atlas-extension": "1.0.0-alpha.2", - "@antora/collector-extension": "1.0.0-beta.2", + "@antora/collector-extension": "1.0.0-beta.3", "@asciidoctor/tabs": "1.0.0-beta.6", "@springio/antora-extensions": "1.14.2", "@springio/asciidoctor-extensions": "1.0.0-alpha.14" From 02fb33a67b5375d37edf76202b85792eda918aa8 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Thu, 17 Oct 2024 15:29:23 +0200 Subject: [PATCH 3/3] Document using configurers and customisers with @LoadBalanced HTTP client builders. Fixes gh-1407. --- .../common-abstractions.adoc | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc b/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc index c8a0f336..a50b6f3f 100644 --- a/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-commons/common-abstractions.adoc @@ -250,6 +250,22 @@ public class MyClass { The URI needs to use a virtual host name (that is, a service name, not a host name). The `BlockingLoadBalancerClient` is used to create a full physical address. +In order to leverage additional capabilities that Spring Boot provides for `RestClient.Builder` (for example, observability support) you may want to use the autoconfigured +`RestClientBuilderConfigurer` while creating the `@LoadBalanced RestClient.Builder` beans: + +[source,java,indent=0] +---- +@Configuration +public class MyConfiguration { + + @LoadBalanced + @Bean + RestClient.Builder restClientBuilder(RestClientBuilderConfigurer configurer) { + return configurer.configure(RestClient.builder()); + } +} +---- + IMPORTANT: To use it, add xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project. [[multiple-restclient-objects]] @@ -330,6 +346,24 @@ public class MyClass { The URI needs to use a virtual host name (that is, a service name, not a host name). The Spring Cloud LoadBalancer is used to create a full physical address. +In order to leverage additional capabilities that Spring Boot provides for `WebClient.Builder` (for example, observability support) you may want to use the autoconfigured +`WebClientCustomizer` beans while creating the `@LoadBalanced WebClient.Builder` beans: + +[source,java,indent=0] +---- +@Configuration +public class MyConfiguration { + + @Bean + @LoadBalanced + public WebClient.Builder loadBalancedWebClientBuilder(ObjectProvider customizerProvider) { + WebClient.Builder builder = WebClient.builder(); + customizerProvider.orderedStream().forEach((customizer) -> customizer.customize(builder)); + return builder; + } +} +---- + IMPORTANT: If you want to use a `@LoadBalanced WebClient.Builder`, you need to have a Spring Cloud LoadBalancer implementation in the classpath. We recommend that you add the xref:spring-cloud-commons/loadbalancer.adoc#spring-cloud-loadbalancer-starter[Spring Cloud LoadBalancer starter] to your project.