Class RoundRobinPartitionKey


  • public final class RoundRobinPartitionKey
    extends Object
    Channel-pool partition key used by LoadBalance.ROUND_ROBIN.

    It augments the regular partition key (produced by the configured ChannelPoolPartitioning) with the resolved IP a request is pinned to, so that pooled HTTP/1.1 connections and multiplexed HTTP/2 connections are kept and reused per IP rather than per host.

    • Constructor Detail

      • RoundRobinPartitionKey

        public RoundRobinPartitionKey​(Object baseKey,
                                      InetAddress address)
    • Method Detail

      • getBaseKey

        public Object getBaseKey()
        Returns:
        the per-host base partition key (without the pinned IP). Lets the HTTP/2 registry group sibling per-IP connections for the same host so a permit-starved request can reuse one (issue #2214).
      • withAddress

        public RoundRobinPartitionKey withAddress​(InetAddress newAddress)
        Returns:
        a key with the same base but a different IP, used to re-pin to the IP actually connected to when the connector fails over from the initially selected IP
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object