Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.
Expected Behavior
org.springframework.web.reactive.function.client.WebClient
could be customized by WebClientCustomizer interface when introducing mcp client starter
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-mcp-client-webflux-spring-boot-starter</artifactId>
</dependency>
Current Behavior
WebClientCustomizer is ignored
Context
WebClient.Builder bean is defined in SseWebFluxTransportAutoConfiguration as
public WebClient.Builder webClientBuilder() {
return WebClient.builder();
}
which override the default bean definition in WebClientAutoConfiguration
public WebClient.Builder webClientBuilder(ObjectProvider<WebClientCustomizer> customizerProvider) {
WebClient.Builder builder = WebClient.builder();
customizerProvider.orderedStream().forEach((customizer) -> customizer.customize(builder));
return builder;
}
Comment From: tzolov
@wwulfric thank you for raising this issue. I believe this PR will resolve it: https://github.com/spring-projects/spring-ai/pull/2444