Package io.micronaut.health
Class HeartbeatConfiguration
- java.lang.Object
-
- io.micronaut.health.HeartbeatConfiguration
-
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("micronaut.heartbeat") public class HeartbeatConfiguration extends java.lang.Object implements io.micronaut.core.util.Toggleable
Configuration for heart beat.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_ENABLED
The default enable value.static int
DEFAULT_INTERVAL_SECONDS
The default interval seconds.static java.lang.String
ENABLED
Whether the heartbeat is enabled.static java.lang.String
PREFIX
The prefix used for the heart beat configuration.
-
Constructor Summary
Constructors Constructor Description HeartbeatConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.time.Duration
getInterval()
boolean
isEnabled()
void
setEnabled(boolean enabled)
Default value (true).void
setInterval(java.time.Duration interval)
Default value (15 seconds).
-
-
-
Field Detail
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLED
The default enable value.- See Also:
- Constant Field Values
-
DEFAULT_INTERVAL_SECONDS
public static final int DEFAULT_INTERVAL_SECONDS
The default interval seconds.- See Also:
- Constant Field Values
-
PREFIX
public static final java.lang.String PREFIX
The prefix used for the heart beat configuration.- See Also:
- Constant Field Values
-
ENABLED
public static final java.lang.String ENABLED
Whether the heartbeat is enabled.- See Also:
- Constant Field Values
-
-
Method Detail
-
getInterval
public java.time.Duration getInterval()
- Returns:
- The interval with which to publish
HeartbeatEvent
instances
-
setInterval
public void setInterval(java.time.Duration interval)
Default value (15 seconds).- Parameters:
interval
- The interval to publishHeartbeatEvent
instances
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
- Returns:
- Whether
HeartbeatEvent
event instances should be published by the server
-
setEnabled
public void setEnabled(boolean enabled)
Default value (true).- Parameters:
enabled
- Enable the publish ofHeartbeatEvent
event instances
-
-