Skip to content

Auto-configure HTTP client builders as lazy #19549

@bclozel

Description

@bclozel

Spring Boot is auto-configuring, if the required classes are present, builders for HTTP clients: RestTemplateBuilder for Spring MVC and WebClient.Builder for Spring WebFlux.

Many web applications only use one of them, or just don't use any. Creating such components does not take a lot of resources, but the underlying infrastructure (including codecs) can take startup time without doing anything useful for the application.

We could make those components lazy by default; such components are used by the application configuration to create new components at startup time, so making those builders lazy will not change the behavior here.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions