[HTTPCLIENT-2178] Implement Happy Eyeballs V2 (RFC 8305)
This pull request introduces a minimal implementation of Happy Eyeballs Version 2 (RFC 8305) for the asynchronous client connection operator in Apache HttpComponents Client 5.x. It focuses on a simple, straightforward approach to dual-stack (IPv6/IPv4) address resolution and staggered connection attempts, while integrating a basic RFC 6724 address selection mechanism.
Key highlights:
-
Minimal RFC 6724 Support: Implements essential rules for address sorting (e.g., precedence, scope, label matching, longest prefix), with source address discovery via UDP probes. Non-critical rules (e.g., deprecated addresses, home addresses) are marked as TODO for future enhancements.
-
Staggered Connections: Uses a single-threaded ScheduledExecutorService for delaying connection attempts (default: 250ms), ensuring compliance with RFC 8305's latency minimization without unnecessary complexity.
-
Integration: Easily configurable via PoolingAsyncClientConnectionManagerBuilder.setConnectionOperator(). Includes shutdown methods for resource management.
@rschmitt Could you please take a look at this PR as you are the requester of this feature?
This is still on my to-do list, I'll get to it when I can.
@ok2c What do you think of the idea of upgrading the existing MultihomeConnectionInitiator/MultihomeIOSessionRequester to support the RFC 8305 connection algorithm?
@ok2c What do you think of the idea of upgrading the existing
MultihomeConnectionInitiator/MultihomeIOSessionRequesterto support the RFC 8305 connection algorithm?
@arturobernalg @rschmitt I am very much in favor of splitting the change-set into several smaller ones starting with MultihomeConnectionInitiator/MultihomeIOSessionRequester.
all right @rschmitt .. i do the changes
@rschmitt please give another change to the PR
@rschmitt @ok2c can we merge the minimal path (staggered multihome + config flag) as experimental and iterate on the rest?
@arturobernalg This feature was requested by @rschmitt and do not think i need to get involved unless absolutely necessary. I suppose if one cannot get a complex feature through a review, splitting it into smaller change-sets is the best thing to do.