Health Check Java Spring
It should also provide the health of the subsystems that the application as dependents on.
Health check java spring. All of these features can be accessed over jmx or http endpoints. Before going further i would like you to read about spring boot s health check indicators as you would get a better understanding of healthindicators. The health check provided by a datasource creates a connection to a database and performs a simple query such as select 1 from dual to check that it is working.
Spring boot actuator s health endpoint checks the health of an application by consolidating multiple health check indicators. Spring boot s health check features are controlled by auto configured beans of healthindicator interface. Here the client faces the following inconveniences.
Health check in detail. Some of the predefined indicators are datasourcehealthindicator diskspacehealthindicator mongohealthindicator redishealthindicator cassandrahealthindicator etc. Health check components can be grouped together for various purposes.
The latency of a health check can give an early indication that a system is degrading and might precede an actual outage. For all of the health checks we measure whether the check is successful and the latency for performing the health check. Spring boot aggregates all health indicators it finds in the application context to create the result of the health endpoint we have seen above.
If we want to we can write our own healthindicator beans. A health check response should not just contain the application server s health. Let us take an example.
These health checks are integrated as so called active checks in our standard plugins for http. For example lets say our application use mail database and rabbitmq for some of its business logic. But there might be cases that some client requests only use database and email functionality.