Class: HealthCheckHandler

vertx-health-checks-js/health_check_handler~ HealthCheckHandler

new HealthCheckHandler()

A Vert.x Web handler on which you register health check procedure. It computes the outcome status (`UP` or `DOWN`) . When the handler process a HTTP request, it computes the global outcome and build a HTTP response as follows:

  • 204 - status is `UP` but no procedures installed (no payload)
  • 200 - status is `UP`, the payload contains the result of the installed procedures
  • 503 - status is `DOWN`, the payload contains the result of the installed procedures
  • 500 - status is `DOWN`, the payload contains the result of the installed procedures, one of the procedure has failed
Source:

Methods

handle(arg0)

Parameters:
Name Type Description
arg0 RoutingContext
Source:

register(name, procedure) → {HealthCheckHandler}

Registers a health check procedure.

The procedure is a taking a of Status as parameter. Procedures are asynchronous, and must complete or fail the given . If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is completed without any object, the procedure outcome is considered as `UP`. If the future is completed with a (not-null) Status, the procedure outcome is the received status.

Parameters:
Name Type Description
name string the name of the procedure, must not be null or empty
procedure function the procedure, must not be null
Source:
Returns:
the current HealthCheckHandler
Type
HealthCheckHandler

unregister(name) → {HealthCheckHandler}

Unregisters a procedure.
Parameters:
Name Type Description
name string the name of the procedure
Source:
Returns:
the current HealthCheckHandler
Type
HealthCheckHandler