Class DiscoveryClientRoundRobinLoadBalancer

java.lang.Object
io.micronaut.http.client.loadbalance.AbstractRoundRobinLoadBalancer
io.micronaut.http.client.loadbalance.DiscoveryClientRoundRobinLoadBalancer
All Implemented Interfaces:
LoadBalancer

public class DiscoveryClientRoundRobinLoadBalancer extends AbstractRoundRobinLoadBalancer

A LoadBalancer that uses the DiscoveryClient and a ServiceInstance ID to automatically load balance between discovered clients in a non-blocking manner.

Note that the when DiscoveryClient caching is enabled then this load balancer may not always have the latest server list from the DiscoveryClient (the default TTL is 30 seconds)

Since:
1.0
Author:
Graeme Rocher
  • Constructor Details

    • DiscoveryClientRoundRobinLoadBalancer

      public DiscoveryClientRoundRobinLoadBalancer(String serviceID, DiscoveryClient discoveryClient)
      Parameters:
      serviceID - The service ID
      discoveryClient - The discovery client
  • Method Details