@RequiresConsul @ConfigurationProperties(value="consul.client") public class ConsulConfiguration extends DiscoveryClientConfiguration
Modifier and Type | Class and Description |
---|---|
static class |
ConsulConfiguration.ConsulConfigDiscoveryConfiguration
Configuration class for Consul client config.
|
static class |
ConsulConfiguration.ConsulConnectionPoolConfiguration
The default connection pool configuration.
|
static class |
ConsulConfiguration.ConsulDiscoveryConfiguration
Configuration class for Consul client discovery.
|
static class |
ConsulConfiguration.ConsulRegistrationConfiguration
Configuration class for Consul client registration.
|
HttpClientConfiguration.ConnectionPoolConfiguration
Modifier and Type | Field and Description |
---|---|
static String |
PREFIX
The prefix to use for all Consul settings.
|
DEFAULT_FOLLOW_REDIRECTS, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_READ_IDLE_TIMEOUT_MINUTES, DEFAULT_READ_TIMEOUT_SECONDS, DEFAULT_SHUTDOWN_TIMEOUT_MILLISECONDS
Constructor and Description |
---|
ConsulConfiguration()
Default Consult configuration.
|
ConsulConfiguration(ConsulConfiguration.ConsulConnectionPoolConfiguration consulConnectionPoolConfiguration,
ApplicationConfiguration applicationConfiguration) |
Modifier and Type | Method and Description |
---|---|
Optional<String> |
getAslToken() |
ConsulConfiguration.ConsulConfigDiscoveryConfiguration |
getConfiguration() |
HttpClientConfiguration.ConnectionPoolConfiguration |
getConnectionPoolConfiguration()
Obtains the connection pool configuration.
|
ConsulConfiguration.ConsulDiscoveryConfiguration |
getDiscovery() |
ConsulConfiguration.ConsulRegistrationConfiguration |
getRegistration() |
protected String |
getServiceID() |
boolean |
isHealthCheck() |
void |
setAslToken(String aslToken) |
void |
setConfiguration(ConsulConfiguration.ConsulConfigDiscoveryConfiguration configuration) |
void |
setDiscovery(ConsulConfiguration.ConsulDiscoveryConfiguration discovery) |
void |
setHealthCheck(boolean healthCheck)
Sets whether the Consul server should be considered for health checks.
|
void |
setRegistration(ConsulConfiguration.ConsulRegistrationConfiguration registration) |
String |
toString() |
getAllZones, getContextPath, getDefaultZone, getHost, getPort, getServiceId, isSecure, isShouldUseDns, setContextPath, setDefaultZone, setHost, setPort, setSecure, setShouldUseDns, setZones
getChannelOptions, getConnectTimeout, getDefaultCharset, getLoggerName, getMaxContentLength, getNumOfThreads, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getShutdownTimeout, getSslConfiguration, getThreadFactory, isFollowRedirects, resolveProxy, setChannelOptions, setConnectTimeout, setDefaultCharset, setFollowRedirects, setLoggerName, setMaxContentLength, setNumOfThreads, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setShutdownTimeout, setSslConfiguration, setThreadFactory
public static final String PREFIX
public ConsulConfiguration()
@Inject public ConsulConfiguration(ConsulConfiguration.ConsulConnectionPoolConfiguration consulConnectionPoolConfiguration, ApplicationConfiguration applicationConfiguration)
consulConnectionPoolConfiguration
- The connection pool configurationapplicationConfiguration
- The application configurationpublic boolean isHealthCheck()
ConsulHealthIndicator
public void setHealthCheck(boolean healthCheck)
healthCheck
- True if it shouldConsulHealthIndicator
public HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()
HttpClientConfiguration
getConnectionPoolConfiguration
in class HttpClientConfiguration
public ConsulConfiguration.ConsulConfigDiscoveryConfiguration getConfiguration()
@Inject public void setConfiguration(ConsulConfiguration.ConsulConfigDiscoveryConfiguration configuration)
configuration
- The ConsulConfiguration.ConsulConfigDiscoveryConfiguration
public Optional<String> getAslToken()
X-Consul-Token
headerpublic void setAslToken(String aslToken)
aslToken
- The asl tokenpublic ConsulConfiguration.ConsulRegistrationConfiguration getRegistration()
getRegistration
in class DiscoveryClientConfiguration
@Inject public void setRegistration(ConsulConfiguration.ConsulRegistrationConfiguration registration)
registration
- The ConsulConfiguration.ConsulRegistrationConfiguration
public ConsulConfiguration.ConsulDiscoveryConfiguration getDiscovery()
getDiscovery
in class DiscoveryClientConfiguration
@Inject public void setDiscovery(ConsulConfiguration.ConsulDiscoveryConfiguration discovery)
discovery
- The ConsulConfiguration.ConsulDiscoveryConfiguration
protected String getServiceID()
getServiceID
in class DiscoveryClientConfiguration
public String toString()
toString
in class DiscoveryClientConfiguration