Skip to content

FeignHttpClientProperties.maxConnectionsPerRoute is not applied to OkHttpClient but only affects Apache HttpClient #1276

@sweat123

Description

@sweat123

Is your feature request related to a problem? Please describe.

I'm frustrated by the fact that FeignHttpClientProperties.maxConnectionsPerRoute parameter only works when using Apache HTTP Client but is completely ignored when using OkHttp client.

Describe the solution you'd like

I would like to see consistent configuration support for connection limits across both HTTP client implementations. The maxConnectionsPerRoute property (and ideally maxConnections) should be respected by the default OkHttp client configuration, just as it is for the Apache client.

Describe alternatives you've considered

I would like to see consistent configuration support for connection limits across both HTTP client implementations. Ideally, one of these solutions:

    @Bean
    public OkHttpClient.Builder okhttpClientBuilder(FeignHttpClientProperties httpClientProperties) {
        Dispatcher dispatcher = new Dispatcher();
        dispatcher.setMaxRequests(httpClientProperties.getMaxConnections());
        dispatcher.setMaxRequestsPerHost(httpClientProperties.getMaxConnectionsPerRoute());
        return new OkHttpClient.Builder()
                .dispatcher(dispatcher);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions