Skip to content

Add JettyResourceFactory [SPR-17179] #21715

Closed
@spring-projects-issues

Description

@spring-projects-issues

Rossen Stoyanchev opened SPR-17179 and commented

Currently the default constructor of JettyClientHttpConnector creates a new HttpClient instance. Arguably this is a little too easy, since unless the connector is re-used across WebClient instances, each will be created with its own resources.

We should instead provide help with creating a Spring-managed Jetty HttpClient instance that can then be shared among clients, and whose resources could also then be shared with a Jetty server (e.g. with WebFlux in non-blocking mode).

The proposed changes are to remove SmartLifecycle from JettyClientHttpConnector and create a JettyHttpClientFactory instead hat manages an HttpClient instance within a Spring ApplicationContext. The connector would then accept a JettyHttpClientFactory or an HttpClient instance.

This would also be consistent with the changes for the ReactorClientHttpConnector as part of #21501.

 

 


Affects: 5.1 RC1

Issue Links:

Referenced from: commits 0dd9e8c, 1eb06fc

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions