See: Description
| Interface | Description |
|---|---|
| HealthCheck |
Interface for health check operations on a Redis endpoint.
|
| HealthCheckStrategy |
Interface for health check strategies.
|
| HealthCheckStrategySupplier |
Supplier for health check strategies.
|
| HealthStatusListener |
Listener for health status changes.
|
| HealthStatusManager |
Manager for health status of Redis endpoints.
|
| ProbingPolicy |
Interface for probing policies.
|
| ProbingPolicy.ProbeContext |
| Class | Description |
|---|---|
| AbstractHealthCheckStrategy |
Abstract base class for health check strategies.
|
| HealthCheckStrategy.Config | |
| HealthCheckStrategy.Config.Builder<T extends HealthCheckStrategy.Config.Builder<T,C>,C extends HealthCheckStrategy.Config> |
Base builder for HealthCheckStrategy.Config and its subclasses.
|
| HealthStatusChangeEvent |
Event arguments for health status change events.
|
| HealthStatusManagerImpl |
Implementation of the
HealthStatusManager interface. |
| LagAwareStrategy |
Health check strategy that uses the Redis Enterprise REST API database availability endpoint.
|
| LagAwareStrategy.Config | |
| LagAwareStrategy.Config.Builder |
Builder for LagAwareStrategy.Config.
|
| PingStrategy |
Health check strategy that uses PING command to check endpoint health.
|
| ProbingPolicy.BuiltIn |
| Enum | Description |
|---|---|
| HealthStatus |
Enumeration representing the health status of a database endpoint as determined by the health check service.
|
| ProbingPolicy.Decision |
| Exception | Description |
|---|---|
| RedisRestException |
Exception thrown when a Redis REST API operation fails.
|
This package provides a pluggable health check system for monitoring Redis database endpoints. Custom health check strategies
can be implemented by extending HealthCheckStrategy.
PingStrategy - Uses Redis PING command
{
@code
public class HttpHealthCheckStrategy extends AbstractHealthCheckStrategy {
private final String healthCheckUrl;
public HttpHealthCheckStrategy(Config config, String healthCheckUrl) {
super(config);
this.healthCheckUrl = healthCheckUrl;
}
@Override
public HealthStatus doHealthCheck(RedisURI endpoint) {
try {
HttpURLConnection conn = (HttpURLConnection) new URL(healthCheckUrl).openConnection();
int code = conn.getResponseCode();
conn.disconnect();
return (code >= 200 && code < 300) ? HealthStatus.HEALTHY : HealthStatus.UNHEALTHY;
} catch (Exception e) {
return HealthStatus.UNHEALTHY;
}
}
}
// Usage:
HealthCheckStrategySupplier supplier = (uri, factory) -> new HttpHealthCheckStrategy(HealthCheckStrategy.Config.create(),
"http://health-endpoint/check");
DatabaseConfig config = DatabaseConfig.builder(redisURI).healthCheckStrategySupplier(supplier).build();
}
Copyright © 2026 lettuce.io. All rights reserved.