eclipse-vertx / eclipse-vertx/vert.x
Custom connection pool strategy in HttpClient
- Dominant language
- Java
- Stars
- 14.7k
- Forks
- 2.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 28
Description
Hi,
Currently, I am using Vert.x 4.5.28, and due to the characteristics of my project and environment, I need to balance requests across all available connections.
I have seen that the default (and currently only) option is the LIFO selector in `SharedClientHttpStreamEndpoint`. This made me wonder whether it would be possible to configure the connection pool strategy for the HttpClient through `HttpClientOptions`.
For example, `HttpClientOptions` could expose an option to configure a `BiFunction, List>, PoolConnection>` , which would be passed to `HttpClientImpl` and then to `SharedClientHttpStreamEndpoint`.
This would allow users to provide their own connection selector implementations when required.
If you think this makes sense, I would be happy to help by creating a PR with the necessary changes.
Thanks!
Contributor guide
Research direction
Start with HttpClientOptions and trace how options reach HttpClientImpl and SharedClientHttpStreamEndpoint. Read the existing LIFO selector and the referenced pool types to understand the selection contract. Done means users can configure a custom connection selector through HttpClientOptions and the endpoint uses it when choosing connections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100