Interface DiscoveryClient
-
- All Superinterfaces:
org.springframework.core.Ordered
- All Known Implementing Classes:
CompositeDiscoveryClient
,SimpleDiscoveryClient
public interface DiscoveryClient extends org.springframework.core.Ordered
Represents read operations commonly available to discovery services such as Netflix Eureka or consul.io.- Author:
- Spencer Gibb, Olga Maciaszek-Sharma, Chris Bono
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_ORDER
Default order of the discovery client.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
description()
A human-readable description of the implementation, used in HealthIndicator.List<ServiceInstance>
getInstances(String serviceId)
Gets all ServiceInstances associated with a particular serviceId.default int
getOrder()
Default implementation for getting order of discovery clients.List<String>
getServices()
default void
probe()
Can be used to verify the client is valid and able to make calls.
-
-
-
Field Detail
-
DEFAULT_ORDER
static final int DEFAULT_ORDER
Default order of the discovery client.- See Also:
- Constant Field Values
-
-
Method Detail
-
description
String description()
A human-readable description of the implementation, used in HealthIndicator.- Returns:
- The description.
-
getInstances
List<ServiceInstance> getInstances(String serviceId)
Gets all ServiceInstances associated with a particular serviceId.- Parameters:
serviceId
- The serviceId to query.- Returns:
- A List of ServiceInstance.
-
probe
default void probe()
Can be used to verify the client is valid and able to make calls.A successful invocation with no exception thrown implies the client is able to make calls.
The default implementation simply calls
getServices()
- client implementations can override with a lighter weight operation if they choose to.
-
getOrder
default int getOrder()
Default implementation for getting order of discovery clients.- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
- Returns:
- order
-
-