Add JettyResourceFactory [SPR-17179] #21715
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Uh oh!
There was an error while loading. Please reload this page.
Rossen Stoyanchev opened SPR-17179 and commented
Currently the default constructor of
JettyClientHttpConnector
creates a newHttpClient
instance. Arguably this is a little too easy, since unless the connector is re-used acrossWebClient
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
fromJettyClientHttpConnector
and create aJettyHttpClientFactory
instead hat manages anHttpClient
instance within a SpringApplicationContext
. The connector would then accept aJettyHttpClientFactory
or anHttpClient
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
The text was updated successfully, but these errors were encountered: