public class DiscoveryClientResolverFactory extends NameResolver.Factory
DiscoveryClientNameResolver based on the target uri.| Modifier and Type | Field and Description |
|---|---|
static Function<String,URI> |
DISCOVERY_DEFAULT_URI_MAPPER
The function that should be used as uri mapper, if discovery-client should be used as default.
|
static String |
DISCOVERY_SCHEME
The constant containing the scheme that will be used by this factory.
|
PARAMS_DEFAULT_PORT, PARAMS_PROXY_DETECTOR| Constructor and Description |
|---|
DiscoveryClientResolverFactory(DiscoveryClient client)
Creates a new discovery client based name resolver factory.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Cleans up the name resolvers.
|
String |
getDefaultScheme() |
void |
heartbeat(HeartbeatEvent event)
Triggers a refresh of the registered name resolvers.
|
NameResolver |
newNameResolver(URI targetUri,
NameResolver.Helper helper)
Deprecated.
|
String |
toString() |
newNameResolver, newNameResolverpublic static final String DISCOVERY_SCHEME
public DiscoveryClientResolverFactory(DiscoveryClient client)
client - The client to use for the address discovery.@Nullable @Deprecated public NameResolver newNameResolver(URI targetUri, NameResolver.Helper helper)
newNameResolver in class NameResolver.Factorypublic String getDefaultScheme()
getDefaultScheme in class NameResolver.Factory@EventListener(value=org.springframework.cloud.client.discovery.event.HeartbeatEvent.class) public void heartbeat(HeartbeatEvent event)
event - The event that triggered the update.@PreDestroy public void destroy()