System operators need to be able to understand if a module instance is healthy enough to be able to participate in the system. FOLIO needs a standard way of allowing operators to determine this.
4 years ago RAML Module Builder defined the
/admin/health endpoint for checking the health of a module. More recently this was included in the formal expectations of a module. Both of these state that the module should always respond with a 200 status code.
John Malconian has proposed that instead of the "health" endpoint, two endpoints: for readiness and liveness check. See the proposal here: - OKAPI-904Getting issue details... STATUS . The proposal has been implemented in Okapi but has not seen much uptake.
All back end modules included in the 2021 R2 (and later) distribution must provide a health check endpoint
The health check endpoint must be provided at the path
The endpoint must respond with a status code 200
The response may include a body of any form
This topic was discussed at the 2021-02-24 Technical Leads meeting.
It was agreed that:
- The existing path should continue to be used given that system operators already rely on it for some modules
- A module is considered healthy if it can respond to requests to the health check endpoint, no other criteria applies at this point
- Discussion about any additional criteria for the health of a back end module has been deferred
For comfortable using health check in spring way - we can use dependency: `spring-boot-starter-actuator`. Just add it in pom.xml:
By default, the health endpoint is mapped to `/actuator/health`. To change it we should add property in the application.properties:
Also swagger automatically generate endpoint on the UI if you use swagger UI:
Example of using: