Class DatabaseHealthIndicator
java.lang.Object
com.kingsrook.qqq.middleware.health.indicators.DatabaseHealthIndicator
- All Implemented Interfaces:
HealthIndicator
Health indicator that checks database connectivity and connection pool health.
This indicator:
- Executes a simple query (SELECT 1) to verify database is reachable
- Checks connection pool statistics if available
- Reports status as UP if query succeeds, DOWN if it fails
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExecute the database health checkGetter for backendNamegetName()Get the name of this health indicatorGetter for timeoutMsvoidsetBackendName(String backendName) Setter for backendNamevoidsetTimeoutMs(Integer timeoutMs) Setter for timeoutMswithBackendName(String backendName) Fluent setter for backendNamewithTimeout(Integer timeoutMs) Fluent setter for timeoutMs
-
Constructor Details
-
DatabaseHealthIndicator
public DatabaseHealthIndicator()Constructor
-
-
Method Details
-
getName
Get the name of this health indicator- Specified by:
getNamein interfaceHealthIndicator- Returns:
- indicator name (e.g., "database", "memory", "diskSpace")
-
check
Execute the database health check- Specified by:
checkin interfaceHealthIndicator- Parameters:
qInstance- the QInstance for accessing backends, configuration, etc.- Returns:
- health check result with status and details
- Throws:
QException- if the check fails catastrophically
-
withBackendName
Fluent setter for backendName -
withTimeout
Fluent setter for timeoutMs -
getBackendName
Getter for backendName -
setBackendName
Setter for backendName -
getTimeoutMs
Getter for timeoutMs -
setTimeoutMs
Setter for timeoutMs
-