Class RegistrationConfiguration
java.lang.Object
io.micronaut.discovery.registration.RegistrationConfiguration
- All Implemented Interfaces:
Toggleable
Common configuration for
ServiceInstance
registration.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default deregister value.static final boolean
The default enable value.static final boolean
The default fail fast value.static final int
The default retry count value.static final int
The default retry delay in seconds.static final String
The prefix to use for all client discovery registration settings. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe IP address to use to register.int
boolean
boolean
boolean
boolean
Should the IP address by used to register with the discovery server.void
setDeregister
(boolean deregister) Default value (true).void
setEnabled
(boolean enabled) Default value (true).void
setFailFast
(boolean failFast) Default value (true).void
setHealthPath
(String healthPath) void
The IP address to use to register.void
setPreferIpAddress
(boolean preferIpAddress) Sets whether the IP address by used to register with the discovery server.void
setRetryCount
(int retryCount) Default value (-1).void
setRetryDelay
(Duration retryDelay) Default value (1 seconds).void
setTimeout
(Duration timeout)
-
Field Details
-
PREFIX
The prefix to use for all client discovery registration settings.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_RETRY_COUNT
public static final int DEFAULT_RETRY_COUNTThe default retry count value.- See Also:
-
DEFAULT_RETRYDELAY_SECONDS
public static final int DEFAULT_RETRYDELAY_SECONDSThe default retry delay in seconds.- See Also:
-
DEFAULT_DEREGISTER
public static final boolean DEFAULT_DEREGISTERThe default deregister value.- See Also:
-
DEFAULT_FAILFAST
public static final boolean DEFAULT_FAILFASTThe default fail fast value.- See Also:
-
-
Constructor Details
-
RegistrationConfiguration
public RegistrationConfiguration()
-
-
Method Details
-
getIpAddr
The IP address to use to register.- Returns:
- The IP address.
-
setIpAddr
The IP address to use to register.- Parameters:
ipAddr
- The ip address
-
isPreferIpAddress
public boolean isPreferIpAddress()Should the IP address by used to register with the discovery server. Defaults to false.- Returns:
- True if the IP address should be used.
-
setPreferIpAddress
public void setPreferIpAddress(boolean preferIpAddress) Sets whether the IP address by used to register with the discovery server. Defaults to false.- Parameters:
preferIpAddress
- True if the IP address should be used
-
getTimeout
- Returns:
- The default timeout for registration
-
setTimeout
- Parameters:
timeout
- The timeout for registration
-
isFailFast
public boolean isFailFast()- Returns:
- Whether to fail server startup if registration fails
-
setFailFast
public void setFailFast(boolean failFast) Default value (true).- Parameters:
failFast
- Whether to fail server startup if registration fails
-
isDeregister
public boolean isDeregister()- Returns:
- Whether to deregister the service on shutdown
-
setDeregister
public void setDeregister(boolean deregister) Default value (true).- Parameters:
deregister
- Whether to deregister the service on shutdown
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceToggleable
- Returns:
- Whether service registration is enabled
-
setEnabled
public void setEnabled(boolean enabled) Default value (true).- Parameters:
enabled
- Whether service registration is enabled
-
getRetryCount
public int getRetryCount()- Returns:
- The number of times to retry registration
-
setRetryCount
public void setRetryCount(int retryCount) Default value (-1).- Parameters:
retryCount
- The retry count
-
getRetryDelay
- Returns:
- The default retry delay
-
setRetryDelay
Default value (1 seconds).- Parameters:
retryDelay
- The retry delay
-
getHealthPath
- Returns:
- The path to the health endpoint
-
setHealthPath
- Parameters:
healthPath
- The health endpoint path
-