Class ConsulDiscoveryProperties
java.lang.Object
org.springframework.cloud.consul.discovery.ConsulDiscoveryProperties
@ConfigurationProperties("spring.cloud.consul.discovery")
public class ConsulDiscoveryProperties
extends Object
Defines configuration for service discovery and registration.
- Author:
- Spencer Gibb, Donnabell Dmello, Venil Noronha, Richard Kettelerij
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classProperties releated to the lifecycle. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConsulDiscoveryProperties(org.springframework.cloud.commons.util.InetUtils inetUtils) -
Method Summary
Modifier and TypeMethodDescriptionintintcom.ecwid.consul.v1.ConsistencyModeintgetOrder()getPort()getQueryTagForService(String serviceId) Gets the tag to use when looking up the instances for a particular service.String[]getQueryTagsForService(String serviceId) Gets the array of tags to use when looking up the instances for a particular service.getTags()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidsetAclToken(String aclToken) voidsetCatalogServicesWatchDelay(int catalogServicesWatchDelay) voidsetCatalogServicesWatchTimeout(int catalogServicesWatchTimeout) voidsetConsistencyMode(com.ecwid.consul.v1.ConsistencyMode consistencyMode) voidsetDatacenters(Map<String, String> datacenters) voidsetDefaultQueryTag(String defaultQueryTag) voidsetDefaultZoneMetadataName(String defaultZoneMetadataName) voidsetDeregister(boolean deregister) voidsetEnabled(boolean enabled) voidsetEnableTagOverride(boolean enableTagOverride) voidsetEnableTagOverride(Boolean enableTagOverride) voidsetFailFast(boolean failFast) voidsetHealthCheckCriticalTimeout(String healthCheckCriticalTimeout) voidsetHealthCheckHeaders(Map<String, List<String>> healthCheckHeaders) voidsetHealthCheckInterval(String healthCheckInterval) voidsetHealthCheckPath(String healthCheckPath) voidsetHealthCheckTimeout(String healthCheckTimeout) voidsetHealthCheckTlsSkipVerify(Boolean healthCheckTlsSkipVerify) voidsetHealthCheckUrl(String healthCheckUrl) voidsetHostname(String hostname) voidsetIncludeHostnameInInstanceId(boolean includeHostnameInInstanceId) voidsetInstanceGroup(String instanceGroup) voidsetInstanceId(String instanceId) voidsetInstanceZone(String instanceZone) voidsetIpAddress(String ipAddress) voidsetLifecycle(ConsulDiscoveryProperties.Lifecycle lifecycle) voidsetManagementEnableTagOverride(Boolean managementEnableTagOverride) voidsetManagementMetadata(Map<String, String> managementMetadata) voidsetManagementPort(Integer managementPort) voidsetManagementSuffix(String managementSuffix) voidsetManagementTags(List<String> managementTags) voidsetMetadata(Map<String, String> metadata) voidsetOrder(int order) voidvoidsetPreferAgentAddress(boolean preferAgentAddress) voidsetPreferIpAddress(boolean preferIpAddress) voidsetQueryPassing(boolean queryPassing) voidsetRegister(boolean register) voidsetRegisterHealthCheck(boolean registerHealthCheck) voidvoidsetServerListQueryTags(Map<String, String> serverListQueryTags) voidsetServiceName(String serviceName) voidtoString()
-
Field Details
-
PREFIX
Consul discovery properties prefix.- See Also:
-
MANAGEMENT
- See Also:
-
-
Constructor Details
-
ConsulDiscoveryProperties
public ConsulDiscoveryProperties(org.springframework.cloud.commons.util.InetUtils inetUtils)
-
-
Method Details
-
getQueryTagForService
Gets the tag to use when looking up the instances for a particular service. If the service has an entry inserverListQueryTagsthat will be used. Otherwise the content ofdefaultQueryTagwill be used.- Parameters:
serviceId- the service whose instances are being looked up- Returns:
- the tag to filter the service instances by or null if no tags are configured for the service and the default query tag is not configured
-
getQueryTagsForService
Gets the array of tags to use when looking up the instances for a particular service. If the service has an entry inserverListQueryTagsthat will be used. Otherwise the content ofdefaultQueryTagwill be used. This differs fromgetQueryTagForService(String)in that it assumes the configured tag property value may represent multiple tags when separated by commas. When the tag property is set to a single tag then this method behaves identical to its aforementioned counterpart except that it returns a single element array with the single tag value.The expected format of the tag property value is
tag1,tag2,..,tagN. Whitespace will be trimmed off each entry.- Parameters:
serviceId- the service whose instances are being looked up- Returns:
- the array of tags to filter the service instances by - it will be null if no tags are configured for the service and the default query tag is not configured or if a single tag is configured and it is the empty string
-
getHostname
-
setHostname
-
getAclToken
-
setAclToken
-
getTags
-
setTags
-
isEnableTagOverride
public boolean isEnableTagOverride() -
setEnableTagOverride
public void setEnableTagOverride(boolean enableTagOverride) -
getMetadata
-
setMetadata
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean enabled) -
getManagementTags
-
setManagementTags
-
getHealthCheckPath
-
setHealthCheckPath
-
getHealthCheckUrl
-
setHealthCheckUrl
-
getHealthCheckHeaders
-
setHealthCheckHeaders
-
getHealthCheckInterval
-
setHealthCheckInterval
-
getHealthCheckTimeout
-
setHealthCheckTimeout
-
getHealthCheckCriticalTimeout
-
setHealthCheckCriticalTimeout
-
getIpAddress
-
setIpAddress
-
getPort
-
setPort
-
getManagementPort
-
setManagementPort
-
getLifecycle
-
setLifecycle
-
isPreferIpAddress
public boolean isPreferIpAddress() -
setPreferIpAddress
public void setPreferIpAddress(boolean preferIpAddress) -
isPreferAgentAddress
public boolean isPreferAgentAddress() -
setPreferAgentAddress
public void setPreferAgentAddress(boolean preferAgentAddress) -
getCatalogServicesWatchDelay
public int getCatalogServicesWatchDelay() -
setCatalogServicesWatchDelay
public void setCatalogServicesWatchDelay(int catalogServicesWatchDelay) -
getCatalogServicesWatchTimeout
public int getCatalogServicesWatchTimeout() -
setCatalogServicesWatchTimeout
public void setCatalogServicesWatchTimeout(int catalogServicesWatchTimeout) -
getServiceName
-
setServiceName
-
getInstanceId
-
setInstanceId
-
getInstanceZone
-
setInstanceZone
-
getInstanceGroup
-
setInstanceGroup
-
isIncludeHostnameInInstanceId
public boolean isIncludeHostnameInInstanceId() -
setIncludeHostnameInInstanceId
public void setIncludeHostnameInInstanceId(boolean includeHostnameInInstanceId) -
getConsistencyMode
public com.ecwid.consul.v1.ConsistencyMode getConsistencyMode() -
setConsistencyMode
public void setConsistencyMode(com.ecwid.consul.v1.ConsistencyMode consistencyMode) -
getDefaultZoneMetadataName
-
setDefaultZoneMetadataName
-
getScheme
-
setScheme
-
getManagementSuffix
-
setManagementSuffix
-
getServerListQueryTags
-
setServerListQueryTags
-
getDatacenters
-
setDatacenters
-
getDefaultQueryTag
-
setDefaultQueryTag
-
isQueryPassing
public boolean isQueryPassing() -
setQueryPassing
public void setQueryPassing(boolean queryPassing) -
isRegister
public boolean isRegister() -
setRegister
public void setRegister(boolean register) -
isDeregister
public boolean isDeregister() -
setDeregister
public void setDeregister(boolean deregister) -
isRegisterHealthCheck
public boolean isRegisterHealthCheck() -
setRegisterHealthCheck
public void setRegisterHealthCheck(boolean registerHealthCheck) -
isFailFast
public boolean isFailFast() -
setFailFast
public void setFailFast(boolean failFast) -
getHealthCheckTlsSkipVerify
-
setHealthCheckTlsSkipVerify
-
getOrder
public int getOrder() -
setOrder
public void setOrder(int order) -
getManagementMetadata
-
setManagementMetadata
-
getEnableTagOverride
-
setEnableTagOverride
-
getManagementEnableTagOverride
-
setManagementEnableTagOverride
-
toString
-