Skip to content

Auto-configure WebClient.Builder components #9522

Closed
@bclozel

Description

@bclozel

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions