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 LoadBalancer
empty()
static LoadBalancer
ALoadBalancer
that does no load balancing and always hits the given URI.static LoadBalancer
Deprecated.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)
insteadALoadBalancer
that does no load balancing and always hits the given URL.- Parameters:
url
- The URL- Returns:
- The
LoadBalancer
-
fixed
ALoadBalancer
that 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