Interface ServiceInstanceChooser
- All Known Subinterfaces:
LoadBalancerClient
public interface ServiceInstanceChooser
Implemented by classes which use a load balancer to choose a server to send a request
to.
- Author:
- Ryan Baxter, Olga Maciaszek-Sharma
-
Method Summary
Modifier and TypeMethodDescriptionChooses a ServiceInstance from the LoadBalancer for the specified service.<T> ServiceInstance
Chooses a ServiceInstance from the LoadBalancer for the specified service and LoadBalancer request.
-
Method Details
-
choose
Chooses a ServiceInstance from the LoadBalancer for the specified service.- Parameters:
serviceId
- The service ID to look up the LoadBalancer.- Returns:
- A ServiceInstance that matches the serviceId.
-
choose
Chooses a ServiceInstance from the LoadBalancer for the specified service and LoadBalancer request.- Type Parameters:
T
- The type of the request context.- Parameters:
serviceId
- The service ID to look up the LoadBalancer.request
- The request to pass on to the LoadBalancer- Returns:
- A ServiceInstance that matches the serviceId.
-