Skip to content

Consider harmonizing the Spring Framework and Spring Boot defaults for RestClient request factory #38856

Closed as not planned
@scottfrederick

Description

@scottfrederick

Spring Framework documents that the default ClientHttpRequestFactory used when building a RestClient is the following, conditional on the classpath:

  • Apache HTTP Client
  • Jetty HTTP Client
  • JDK HTTP Client
  • SimpleClientHttpRequestFactory

Spring Boot's RestClient auto-configuration overrides the request factory using ClientHttpRequestFactories, which has the following order:

  • Apache HTTP Client
  • Jetty HTTP Client
  • OkHttp3 Client (deprecated)
  • SimpleClientHttpRequestFactory

The result is that the JDK HTTP client is not considered when Spring Boot auto-configures the RestClient. We should consider bringing the Boot defaults in line with Framework.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: declinedA suggestion or change that we don't feel we should currently apply

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions