Class DynamicServiceInstanceProvider
- java.lang.Object
-
- org.springframework.cloud.client.hypermedia.DynamicServiceInstanceProvider
-
- All Implemented Interfaces:
ServiceInstanceProvider
public class DynamicServiceInstanceProvider extends Object implements ServiceInstanceProvider
ServiceInstanceProviderto work with aDiscoveryClientto 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 ServiceInstancegetServiceInstance()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:ServiceInstanceProviderReturns the service instance or null if the service is currently unavailable.- Specified by:
getServiceInstancein interfaceServiceInstanceProvider- Returns:
- The service instance, or null if the service is currently unavailable.
-
-