Class WatchConfiguration
java.lang.Object
io.micronaut.discovery.consul.watch.WatchConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("consul.client.watch")
public class WatchConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
Configuration for Consul
Watcher.- Since:
- 4.6.0
- Author:
- LE GALL BenoƮt
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanThe default enable value.static final org.slf4j.event.LevelThe default kvNotFoundLogLevel value.static final IntegerThe default maxRetryAttempts value.static final IntegerThe default retryDelayMs value.static final StringThe prefix to use for Consul's watcher settings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull org.slf4j.event.Level@NonNull Integer@NonNull IntegerbooleanvoidsetEnabled(boolean enabled) Sets whether Configuration watching is enabled.voidsetKvNotFoundLogLevel(@NonNull org.slf4j.event.Level kvNotFoundLogLevel) voidsetMaxRetryAttempts(@NonNull Integer maxRetryAttempts) voidsetRetryDelayMs(@NonNull Integer retryDelayMs)
-
Field Details
-
PREFIX
The prefix to use for Consul's watcher settings.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_MAX_RETRIES
The default maxRetryAttempts value. -
DEFAULT_RETRY_DELAY
The default retryDelayMs value. -
DEFAULT_KV_NOT_FOUND_LOG_LEVEL
public static final org.slf4j.event.Level DEFAULT_KV_NOT_FOUND_LOG_LEVELThe default kvNotFoundLogLevel value.
-
-
Constructor Details
-
WatchConfiguration
public WatchConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceio.micronaut.core.util.Toggleable
-
setEnabled
public void setEnabled(boolean enabled) Sets whether Configuration watching is enabled. Default value (false).- Parameters:
enabled- True if it is enabled
-
getMaxRetryAttempts
- Returns:
- Maximum number of retry attempts. Default to
- Since:
- 4.7.2
-
setMaxRetryAttempts
- Parameters:
maxRetryAttempts- Maximum number of retry attempts.- Since:
- 4.7.2
-
getRetryDelayMs
- Returns:
- Delay in milliseconds between retry attempts. Default to
- Since:
- 4.7.2
-
setRetryDelayMs
- Parameters:
retryDelayMs- Delay in milliseconds between retry attempts- Since:
- 4.7.2
-
getKvNotFoundLogLevel
@NonNull public @NonNull org.slf4j.event.Level getKvNotFoundLogLevel()- Returns:
- Level to use to log NOT_FOUND KeyValue. Default to
Level.INFO - Since:
- 4.7.2
-
setKvNotFoundLogLevel
public void setKvNotFoundLogLevel(@NonNull @NonNull org.slf4j.event.Level kvNotFoundLogLevel) - Parameters:
kvNotFoundLogLevel- Level to use to log NOT_FOUND KeyValue- Since:
- 4.7.2
-