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 JettyClientHttpConnector that accepts a HttpClient instance and a JettyResourceFactory #22977

Closed
philwebb opened this issue May 15, 2019 · 0 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

See spring-projects/spring-boot#16810 for background.

Currently JettyClientHttpConnector has the following constructor:

public JettyClientHttpConnector(
		JettyResourceFactory resourceFactory, @Nullable Consumer<HttpClient> customizer) {
	HttpClient httpClient = new HttpClient();
	httpClient.setExecutor(resourceFactory.getExecutor());
	httpClient.setByteBufferPool(resourceFactory.getByteBufferPool());
	httpClient.setScheduler(resourceFactory.getScheduler());
	if (customizer != null) {
		customizer.accept(httpClient);
	}
	this.httpClient = httpClient;
}

This allows us to apply settings to the HttpClient from the resourceFactory and apply additional customization. Unfortunately, the only way we can change the sslContextFactory is when constructing the HttpClient (we can't use the customizer). This means we're forced to copy/paste the code that applies theresourceFactory items.

Could we please have an additional constructor that takes a HttpClient instance and still applies the JettyResourceFactory settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants