Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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

Hierarchy

  • HealthCheckHandler

Implements

  • any

Index

Methods

handle

  • handle(arg0: RoutingContext): void
  • Parameters

    • arg0: RoutingContext

    Returns void

register

  • 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.

    This method uses a 1s timeout. To configure the timeout use {@link HealthCheckHandler#register}.

    Parameters

    • name: string
    • procedure: ((res: Promise<Status>) => void) | Handler<Promise<Status>>

    Returns 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: string
    • timeout: number
    • procedure: ((res: Promise<Status>) => void) | Handler<Promise<Status>>

    Returns HealthCheckHandler

resultMapper

unregister

  • Unregisters a procedure.

    Parameters

    • name: string

    Returns HealthCheckHandler

Static create

  • Creates an instance of the default implementation of the HealthCheckHandler. This function creates a new instance of HealthChecks.

    Parameters

    • vertx: Vertx
    • provider: AuthenticationProvider

    Returns HealthCheckHandler

  • Creates an instance of the default implementation of the HealthCheckHandler. This function creates a new instance of HealthChecks.

    Parameters

    • vertx: Vertx

    Returns HealthCheckHandler

Static createWithHealthChecks

Generated using TypeDoc