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
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default deregister value.static final booleanThe default enable value.static final booleanThe default fail fast value.static final intThe default retry count value.static final intThe default retry delay in seconds.static final StringThe prefix to use for all client discovery registration settings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe IP address to use to register.intbooleanbooleanbooleanbooleanShould the IP address by used to register with the discovery server.voidsetDeregister(boolean deregister) Default value (true).voidsetEnabled(boolean enabled) Default value (true).voidsetFailFast(boolean failFast) Default value (true).voidsetHealthPath(String healthPath) voidThe IP address to use to register.voidsetPreferIpAddress(boolean preferIpAddress) Sets whether the IP address by used to register with the discovery server.voidsetRetryCount(int retryCount) Default value (-1).voidsetRetryDelay(Duration retryDelay) Default value (1 seconds).voidsetTimeout(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:
isEnabledin 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
-