@Experimental public interface HealthCheck
A health check periodically monitors the health status of a Redis endpoint and notifies registered listeners when the status changes.
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(HealthStatusListener listener)
Add a listener to be notified when the health status changes.
|
RedisURI |
getEndpoint()
Get the endpoint being monitored.
|
long |
getMaxWaitFor()
Get the maximum wait duration (in milliseconds) to wait for health check HealthStatus reach stable state.
|
HealthStatus |
getStatus()
Get the current health status of the endpoint.
|
void |
removeListener(HealthStatusListener listener)
Remove a previously registered listener.
|
void |
start()
Start the health check.
|
void |
stop()
Stop the health check.
|
RedisURI getEndpoint()
HealthStatus getStatus()
void stop()
void start()
long getMaxWaitFor()
Transition to stable state means either HEALTHY or UNHEALTHY. UNKNOWN is not considered stable. This is calculated based on the health check strategy's timeout, retry delay and retry count.
void addListener(HealthStatusListener listener)
The listener will be invoked whenever the health status transitions from one state to another (e.g., HEALTHY to UNHEALTHY, UNKNOWN to HEALTHY, etc.).
listener - the listener to add, must not be nullvoid removeListener(HealthStatusListener listener)
listener - the listener to remove, must not be nullCopyright © 2026 lettuce.io. All rights reserved.