Package io.micronaut.health
Class HeartbeatConfiguration
java.lang.Object
io.micronaut.health.HeartbeatConfiguration
- All Implemented Interfaces:
Toggleable
@ConfigurationProperties("micronaut.heartbeat")
public class HeartbeatConfiguration
extends Object
implements Toggleable
Configuration for heart beat.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
setEnabled
(boolean enabled) Default value (true).void
setInterval
(Duration interval) Default value (15 seconds).
-
Field Details
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_INTERVAL_SECONDS
public static final int DEFAULT_INTERVAL_SECONDSThe default interval seconds.- See Also:
-
PREFIX
The prefix used for the heart beat configuration.- See Also:
-
ENABLED
Whether the heartbeat is enabled.- See Also:
-
-
Constructor Details
-
HeartbeatConfiguration
public HeartbeatConfiguration()
-
-
Method Details
-
getInterval
- Returns:
- The interval with which to publish
HeartbeatEvent
instances
-
setInterval
Default value (15 seconds).- Parameters:
interval
- The interval to publishHeartbeatEvent
instances
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceToggleable
- 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
-