Skip to content

Add support for configuring HttpClientTransport in JettyClientHttpConnectorBuilder #47251

@nstdio

Description

@nstdio

The org.springframework.boot.http.client.reactive.JettyClientHttpConnectorBuilder is very useful, but configuration
for org.eclipse.jetty.client.HttpClientTransport perhaps isn't flexible enough. Apparently there's no way to configure
HttpClientTransport for example in this manner:

    Info h1 = HttpClientConnectionFactory.HTTP11;
    Info h2 = new ClientConnectionFactoryOverHTTP2.HTTP2(new HTTP2Client(clientConnector));

    new HttpClientTransportDynamic(clientConnector, h2, h1);

If we have a requirement for such configuration, we have no choice rather than to forfeit all the benefits of
autoconfiguration for org.springframework.http.client.reactive.ClientHttpConnector and define required components
manually. In our case it's 4 components of the following types:

  • org.eclipse.jetty.io.ClientConnector.ClientConnector
  • org.eclipse.jetty.client.HttpClientTransport
  • org.eclipse.jetty.client.HttpClient
  • and finally org.springframework.http.client.reactive.ClientHttpConnector

Of course, all of them need configuration callbacks, as a result we essentially recreated an awkward copy of
Spring Boot's autoconfiguration.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions