In order to apply #9166 to WebClient instances, we need to customize WebClient.Builder instances with Boot's configuration. One could compare this feature with the RestTemplateBuilder, but there are a few differences:
WebClient.Builder already exists in webflux
WebClient.Builder is stateful, meaning we can't expose it as a singleton component, otherwise further customizations made by Spring developers might be applied in different, unintended, places
WebClient.Builder has a clone method
WebClient is itself stateless but can expose a new builder instance with its mutate method
- Spring Boot should apply a few auto-configured customizations on the
WebClient.Builder (like codecs), and then give that to developers for further changes
In order to apply #9166 to
WebClientinstances, we need to customizeWebClient.Builderinstances with Boot's configuration. One could compare this feature with theRestTemplateBuilder, but there are a few differences:WebClient.Builderalready exists in webfluxWebClient.Builderis stateful, meaning we can't expose it as a singleton component, otherwise further customizations made by Spring developers might be applied in different, unintended, placesWebClient.Builderhas a clone methodWebClientis itself stateless but can expose a new builder instance with itsmutatemethodWebClient.Builder(like codecs), and then give that to developers for further changes