Class DynamicServiceInstanceProvider
- java.lang.Object
-
- org.springframework.cloud.client.hypermedia.DynamicServiceInstanceProvider
-
- All Implemented Interfaces:
ServiceInstanceProvider
public class DynamicServiceInstanceProvider extends Object implements ServiceInstanceProvider
ServiceInstanceProvider
to work with aDiscoveryClient
to look up a service by name. Picks the first one returned by the configuredDiscoveryClient
.- Author:
- Oliver Gierke
-
-
Constructor Summary
Constructors Constructor Description DynamicServiceInstanceProvider(DiscoveryClient client, String serviceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServiceInstance
getServiceInstance()
Returns the service instance or null if the service is currently unavailable.
-
-
-
Constructor Detail
-
DynamicServiceInstanceProvider
public DynamicServiceInstanceProvider(DiscoveryClient client, String serviceName)
-
-
Method Detail
-
getServiceInstance
public ServiceInstance getServiceInstance()
Description copied from interface:ServiceInstanceProvider
Returns the service instance or null if the service is currently unavailable.- Specified by:
getServiceInstance
in interfaceServiceInstanceProvider
- Returns:
- The service instance, or null if the service is currently unavailable.
-
-