This can be done by using the withData method of the health check response builder API. In this part, we extend our Database connection well being check with the option of stating that our utility isn’t able to course of requests because the underlying database connection can’t be established. For simplicity causes, we only decide whether or not the database is accessible or not by a configuration property.
More details about which well being verify procedures ought to be used in which state of affairs is detailed within the MicroProfile Health specification. Generally, the liveness procedures decide whether the appliance ought to be restarted whereas readiness procedures determine whether or not it is smart to contact the appliance with requests. We will create one other health check procedure that simulates a connection to an external service provider such as a database. For starters, we will all the time … Read More