From 74a5d13fe9c034b0358b310eea31dad7c6193a8a Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 12 Sep 2025 13:50:30 -0700 Subject: [PATCH] Polish HTTP Service client auto-configuration --- .../service/HttpServiceClientAutoConfiguration.java | 10 ++-------- .../ReactiveHttpServiceClientAutoConfiguration.java | 10 ++-------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/module/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/autoconfigure/service/HttpServiceClientAutoConfiguration.java b/module/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/autoconfigure/service/HttpServiceClientAutoConfiguration.java index 82fbb354421..e0a22e8e216 100644 --- a/module/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/autoconfigure/service/HttpServiceClientAutoConfiguration.java +++ b/module/spring-boot-restclient/src/main/java/org/springframework/boot/restclient/autoconfigure/service/HttpServiceClientAutoConfiguration.java @@ -32,15 +32,12 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.web.client.ApiVersionFormatter; import org.springframework.web.client.ApiVersionInserter; +import org.springframework.web.client.RestClient; import org.springframework.web.client.support.RestClientAdapter; import org.springframework.web.service.registry.HttpServiceProxyRegistry; -import org.springframework.web.service.registry.ImportHttpServices; /** - * AutoConfiguration for Spring HTTP Service clients. - *

- * This will result in the creation of blocking HTTP Service client beans defined by - * {@link ImportHttpServices @ImportHttpServices} annotations. + * AutoConfiguration for Spring HTTP Service clients backed by {@link RestClient}. * * @author Olga Maciaszek-Sharma * @author Rossen Stoyanchev @@ -57,9 +54,6 @@ public final class HttpServiceClientAutoConfiguration implements BeanClassLoader @SuppressWarnings("NullAway.Init") private ClassLoader beanClassLoader; - HttpServiceClientAutoConfiguration() { - } - @Override public void setBeanClassLoader(ClassLoader classLoader) { this.beanClassLoader = classLoader; diff --git a/module/spring-boot-webclient/src/main/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfiguration.java b/module/spring-boot-webclient/src/main/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfiguration.java index 56001641129..b1f97674cf4 100644 --- a/module/spring-boot-webclient/src/main/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfiguration.java +++ b/module/spring-boot-webclient/src/main/java/org/springframework/boot/webclient/autoconfigure/service/ReactiveHttpServiceClientAutoConfiguration.java @@ -31,15 +31,12 @@ import org.springframework.boot.webclient.autoconfigure.WebClientAutoConfigurati import org.springframework.context.annotation.Bean; import org.springframework.web.client.ApiVersionFormatter; import org.springframework.web.client.ApiVersionInserter; +import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.function.client.support.WebClientAdapter; import org.springframework.web.service.registry.HttpServiceProxyRegistry; -import org.springframework.web.service.registry.ImportHttpServices; /** - * AutoConfiguration for Spring reactive HTTP Service Clients. - *

- * This will result in the creation of reactive HTTP Service client beans defined by - * {@link ImportHttpServices @ImportHttpServices} annotations. + * AutoConfiguration for Spring reactive HTTP Service Clients backed by {@link WebClient}. * * @author Olga Maciaszek-Sharma * @author Rossen Stoyanchev @@ -55,9 +52,6 @@ public final class ReactiveHttpServiceClientAutoConfiguration implements BeanCla @SuppressWarnings("NullAway.Init") private ClassLoader beanClassLoader; - ReactiveHttpServiceClientAutoConfiguration() { - } - @Override public void setBeanClassLoader(ClassLoader classLoader) { this.beanClassLoader = classLoader;