Package io.micronaut.http.client
Interface LoadBalancer
- All Known Implementing Classes:
AbstractRoundRobinLoadBalancer,DiscoveryClientRoundRobinLoadBalancer,FixedLoadBalancer,ServiceInstanceListRoundRobinLoadBalancer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface to abstract server selection. Allows plugging in load balancing strategies.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Summary
Modifier and TypeMethodDescriptionstatic LoadBalancerempty()static LoadBalancerALoadBalancerthat does no load balancing and always hits the given URI.static LoadBalancerDeprecated.default Publisher<ServiceInstance>select()
-
Method Details
-
select
- Parameters:
discriminator- An object used to discriminate the server to select. Usually the service ID- Returns:
- The selected
ServiceInstance
-
getContextPath
- Returns:
- The context path to use for requests.
-
select
- Returns:
- The selected
ServiceInstance
-
fixed
Deprecated.Usefixed(URI)insteadALoadBalancerthat does no load balancing and always hits the given URL.- Parameters:
url- The URL- Returns:
- The
LoadBalancer
-
fixed
ALoadBalancerthat does no load balancing and always hits the given URI.- Parameters:
uri- The URI- Returns:
- The
LoadBalancer
-
empty
- Returns:
- An error because there are no load balancer
-
fixed(URI)instead