Class RegistrationConfiguration
- java.lang.Object
-
- io.micronaut.discovery.registration.RegistrationConfiguration
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
public abstract class RegistrationConfiguration extends java.lang.Object implements io.micronaut.core.util.Toggleable
Common configuration forServiceInstance
registration.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_DEREGISTER
The default deregister value.static boolean
DEFAULT_ENABLED
The default enable value.static boolean
DEFAULT_FAILFAST
The default fail fast value.static int
DEFAULT_RETRY_COUNT
The default retry count value.static int
DEFAULT_RETRYDELAY_SECONDS
The default retry delay in seconds.static java.lang.String
PREFIX
The prefix to use for all client discovery registration settings.
-
Constructor Summary
Constructors Constructor Description RegistrationConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<java.lang.String>
getHealthPath()
java.util.Optional<java.lang.String>
getIpAddr()
The IP address to use to register.int
getRetryCount()
java.time.Duration
getRetryDelay()
java.util.Optional<java.time.Duration>
getTimeout()
boolean
isDeregister()
boolean
isEnabled()
boolean
isFailFast()
boolean
isPreferIpAddress()
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(java.lang.String healthPath)
void
setIpAddr(java.lang.String ipAddr)
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(java.time.Duration retryDelay)
Default value (1 seconds).void
setTimeout(java.time.Duration timeout)
-
-
-
Field Detail
-
PREFIX
public static final java.lang.String PREFIX
The prefix to use for all client discovery registration settings.- See Also:
- Constant Field Values
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
The default enable value.- See Also:
- Constant Field Values
-
DEFAULT_RETRY_COUNT
public static final int DEFAULT_RETRY_COUNT
The default retry count value.- See Also:
- Constant Field Values
-
DEFAULT_RETRYDELAY_SECONDS
public static final int DEFAULT_RETRYDELAY_SECONDS
The default retry delay in seconds.- See Also:
- Constant Field Values
-
DEFAULT_DEREGISTER
public static final boolean DEFAULT_DEREGISTER
The default deregister value.- See Also:
- Constant Field Values
-
DEFAULT_FAILFAST
public static final boolean DEFAULT_FAILFAST
The default fail fast value.- See Also:
- Constant Field Values
-
-
Method Detail
-
getIpAddr
public java.util.Optional<java.lang.String> getIpAddr()
The IP address to use to register.- Returns:
- The IP address.
-
setIpAddr
public void setIpAddr(@Nullable java.lang.String ipAddr)
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
public java.util.Optional<java.time.Duration> getTimeout()
- Returns:
- The default timeout for registration
-
setTimeout
public void setTimeout(java.time.Duration timeout)
- 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 interfaceio.micronaut.core.util.Toggleable
- 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
public java.time.Duration getRetryDelay()
- Returns:
- The default retry delay
-
setRetryDelay
public void setRetryDelay(java.time.Duration retryDelay)
Default value (1 seconds).- Parameters:
retryDelay
- The retry delay
-
getHealthPath
public java.util.Optional<java.lang.String> getHealthPath()
- Returns:
- The path to the health endpoint
-
setHealthPath
public void setHealthPath(java.lang.String healthPath)
- Parameters:
healthPath
- The health endpoint path
-
-