Package io.micronaut.discovery.client
Class DiscoveryClientConfiguration
java.lang.Object
io.micronaut.http.client.HttpClientConfiguration
io.micronaut.discovery.client.DiscoveryClientConfiguration
- Direct Known Subclasses:
ConsulConfiguration
,EurekaConfiguration
public abstract class DiscoveryClientConfiguration
extends io.micronaut.http.client.HttpClientConfiguration
Abstract class for all
DiscoveryClient
configurations.- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from class io.micronaut.http.client.HttpClientConfiguration
io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
-
Field Summary
Fields inherited from class io.micronaut.http.client.HttpClientConfiguration
DEFAULT_ALLOW_BLOCK_EVENT_LOOP, DEFAULT_CONNECTION_POOL_IDLE_TIMEOUT_SECONDS, DEFAULT_EXCEPTION_ON_ERROR_STATUS, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_READ_IDLE_TIMEOUT_MINUTES, DEFAULT_READ_TIMEOUT_SECONDS, DEFAULT_SHUTDOWN_QUIET_PERIOD_MILLISECONDS, DEFAULT_SHUTDOWN_TIMEOUT_MILLISECONDS
-
Constructor Summary
ConstructorDescriptionDefault constructor.DiscoveryClientConfiguration
(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionList<io.micronaut.discovery.ServiceInstance>
List<io.micronaut.discovery.ServiceInstance>
abstract @NonNull io.micronaut.discovery.DiscoveryConfiguration
@NonNull String
getHost()
int
getPort()
abstract @Nullable io.micronaut.discovery.registration.RegistrationConfiguration
protected abstract String
boolean
isSecure()
boolean
Whether DNS should be used to resolve the discovery servers.void
setContextPath
(String contextPath) Sets the context path.void
setDefaultZone
(List<URL> defaultZone) Sets the Discovery servers to use for the default zone.void
void
setPort
(int port) void
setSecure
(boolean secure) void
setShouldUseDns
(boolean shouldUseDns) Whether DNS should be used to resolve the discovery servers.void
Configures Discovery servers in other zones.toString()
Methods inherited from class io.micronaut.http.client.HttpClientConfiguration
getAlpnModes, getChannelOptions, getConnectionPoolConfiguration, getConnectionPoolIdleTimeout, getConnectTimeout, getConnectTtl, getDefaultCharset, getEventLoopGroup, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getPlaintextMode, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getShutdownQuietPeriod, getShutdownTimeout, getSslConfiguration, getThreadFactory, isAllowBlockEventLoop, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setAllowBlockEventLoop, setAlpnModes, setChannelOptions, setConnectionPoolIdleTimeout, setConnectTimeout, setConnectTtl, setDefaultCharset, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setPlaintextMode, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setShutdownQuietPeriod, setShutdownTimeout, setSslConfiguration, setThreadFactory
-
Constructor Details
-
DiscoveryClientConfiguration
public DiscoveryClientConfiguration()Default constructor. -
DiscoveryClientConfiguration
public DiscoveryClientConfiguration(io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) - Parameters:
applicationConfiguration
- The application configuration.
-
-
Method Details
-
isShouldUseDns
public boolean isShouldUseDns()Whether DNS should be used to resolve the discovery servers.- Returns:
- True if DNS should be used.
-
setShouldUseDns
public void setShouldUseDns(boolean shouldUseDns) Whether DNS should be used to resolve the discovery servers.- Parameters:
shouldUseDns
- True if DNS should be used.
-
getContextPath
- Returns:
- The context path to use
-
setContextPath
Sets the context path.- Parameters:
contextPath
- The context path
-
getServiceId
- Returns:
- Resolves the service ID to use
-
getDefaultZone
- Returns:
- The Discovery servers within the default zone
-
setDefaultZone
Sets the Discovery servers to use for the default zone.- Parameters:
defaultZone
- The default zone
-
getAllZones
- Returns:
- The Discovery servers within all zones
-
setZones
Configures Discovery servers in other zones.- Parameters:
zones
- The zones
-
isSecure
public boolean isSecure()- Returns:
- Is the discovery server exposed over HTTPS (defaults to false)
-
setSecure
public void setSecure(boolean secure) - Parameters:
secure
- Set if the discovery server is exposed over HTTPS
-
getHost
- Returns:
- The Discovery server instance host name. Defaults to 'localhost'.
-
setHost
- Parameters:
host
- The Discovery server host name
-
getPort
public int getPort()- Returns:
- The default Discovery server port
-
setPort
public void setPort(int port) - Parameters:
port
- The port for the Discovery server
-
getDiscovery
@NonNull public abstract @NonNull io.micronaut.discovery.DiscoveryConfiguration getDiscovery()- Returns:
- The default discovery configuration
-
getRegistration
@Nullable public abstract @Nullable io.micronaut.discovery.registration.RegistrationConfiguration getRegistration()- Returns:
- The default registration configuration
-
toString
-
getServiceID
- Returns:
- The ID of the
DiscoveryClient
-