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

Java 8 Connection Reset (Cont'd) #68

Open
amwakefield-olson opened this issue Dec 12, 2024 · 0 comments
Open

Java 8 Connection Reset (Cont'd) #68

amwakefield-olson opened this issue Dec 12, 2024 · 0 comments

Comments

@amwakefield-olson
Copy link

Hello!

We are still experiencing Connection Reset issues with the Pooling Manager as it stands today. I was wondering if y'all would be able to make an update to allow us to be able to set custom max total and default routes per connection within the HttpClient constructor.

Here is an example.

public HttpClient(Map<String, Object> headers, int connectTimeoutSeconds, int readTimeoutSeconds, int totalMaxConnections, int defaultConnectionMaxPerRoute) {
        this.headers = headers;
        this.clientConfigBuilder = RequestConfig
                .custom()
                .setConnectTimeout(Timeout.ofSeconds(connectTimeoutSeconds))
                .setConnectionRequestTimeout(Timeout.ofSeconds(connectTimeoutSeconds))
                .setConnectionKeepAlive(Timeout.ofSeconds(connectTimeoutSeconds))
                .setResponseTimeout(Timeout.ofSeconds(readTimeoutSeconds));

        this.connectionManager = new PoolingHttpClientConnectionManager();
        connectionManager.setMaxTotal(totalMaxConnections);
        connectionManager.setDefaultMaxPerRoute(defaultConnectionMaxPerRoute);

        this.client = HttpClients.custom().setConnectionManager(connectionManager).build();
  }

Thanks!

Allan

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

No branches or pull requests

1 participant