Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JettyResourceFactory [SPR-17179] #21715

spring-projects-issues opened this issue Aug 14, 2018 · 0 comments

Add JettyResourceFactory [SPR-17179] #21715

spring-projects-issues opened this issue Aug 14, 2018 · 0 comments


Copy link

@spring-projects-issues spring-projects-issues commented Aug 14, 2018

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:

  • #19658 Jetty HTTP client integration with WebClient
  • #21501 Make it easier to tidy up the resources used by a WebClient

Referenced from: commits 0dd9e8c, 1eb06fc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants