public interface LoadBalancerClient extends ServiceInstanceChooser
| Modifier and Type | Method and Description |
|---|---|
<T> T |
execute(String serviceId,
LoadBalancerRequest<T> request)
Executes request using a ServiceInstance from the LoadBalancer for the specified
service.
|
<T> T |
execute(String serviceId,
ServiceInstance serviceInstance,
LoadBalancerRequest<T> request)
Executes request using a ServiceInstance from the LoadBalancer for the specified
service.
|
URI |
reconstructURI(ServiceInstance instance,
URI original)
Creates a proper URI with a real host and port for systems to utilize.
|
choose<T> T execute(String serviceId, LoadBalancerRequest<T> request) throws IOException
T - type of the responseserviceId - The service ID to look up the LoadBalancer.request - Allows implementations to execute pre and post actions, such as
incrementing metrics.IOException - in case of IO issues.<T> T execute(String serviceId, ServiceInstance serviceInstance, LoadBalancerRequest<T> request) throws IOException
T - type of the responseserviceId - The service ID to look up the LoadBalancer.serviceInstance - The service to execute the request to.request - Allows implementations to execute pre and post actions, such as
incrementing metrics.IOException - in case of IO issues.URI reconstructURI(ServiceInstance instance, URI original)
instance - service instance to reconstruct the URIoriginal - A URI with the host as a logical service name.Copyright © 2020 Pivotal Software, Inc.. All rights reserved.