Reuse data source validation query in health endpoint
This commit improves DataSourceMetadata to expose the validation query. This can be used by DataSourceHealthIndicator as the query to use instead of "guessing" which query could be applied according to the database type. Fixes gh-1282
This commit is contained in:
@@ -164,8 +164,8 @@ To provide custom health information you can register a Spring bean that impleme
|
||||
|
||||
Spring Boot provides a
|
||||
{sc-spring-boot-actuator}/health/DataSourceHealthIndicator.{sc-ext}[`DataSourceHealthIndicator`]
|
||||
implementation that attempts a simple database test as well as implementations for
|
||||
Redis, MongoDB and RabbitMQ.
|
||||
implementation that attempts a simple database test (reusing the validation query set on the data
|
||||
source, if any) as well as implementations for Redis, MongoDB and RabbitMQ.
|
||||
|
||||
Spring Boot adds the `HealthIndicator` instances automatically if beans of type `DataSource`,
|
||||
`MongoTemplate`, `RedisConnectionFactory`, `RabbitTemplate` are present in the `ApplicationContext`.
|
||||
|
||||
Reference in New Issue
Block a user