-
Notifications
You must be signed in to change notification settings - Fork 3k
Dropwizard HealthChecks
HikariCP 2.3.2+ supports Dropwizard (formerly Codahale) HealthChecks.
You can enable health checks by configuring a HealthCheckRegistry
instance in HikariConfig
or HikariDataSource
(depending on which you use for configuration). There is a method, setHealthCheckRegistry(HealthCheckRegistry)
, for this purpose.
HikariConfig
also supports additional health check specific configuration through the addHealthCheckProperty(key, value)
and/or setHealthCheckProperties(Properties)
methods. The properties specific to each health check is documented below.
This health check will obtain a Connection
from the pool and immediately return it. The standard HikariCP internal "aliveness" check will be run.
By default this health check will use the standard pool connectionTimeout
when obtaining a Connection
. However, if the connectionTimeout
is disabled (set to 0
) then a timeout of 10 seconds will be used.
A specific timeout can also be set through a health check property called connectivityCheckTimeoutMs
:
config.addHealthCheckProperty("connectivityCheckTimeoutMs", "1000");