Skip to content

Allow configuring timeToLive for the connection pool #286

@maxceban

Description

@maxceban

Is your feature request related to a problem? Please describe.
We are having some issues with regards to connection pools when releasing a new version of the service called by the unirest client. This release process involves updating the DNS entry for the load balancer and the clients need to refresh the connections in order to start calling the new version of the service. We're looking into making it happen by leveraging the timeToLive functionality of the CPool used by the underlying apache client. However, currently it's really hard to propagate this value to the pool instance and by default, this ttl is infinite.

Describe the solution you'd like
Exposing an additional configuration parameter (connectionTimeToLive) in the kong.unirest.Config that would be picked up when initializing the PoolingNHttpClientConnectionManager from the ApacheAsyncClient.

Describe alternatives you've considered
I've considered providing a custom instance of AsyncClient, but that involves a lot of duplication of the code already taken care of by ApacheAsyncClient.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature RequestValid feature request to add to the backlog

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions