Class HealthGetHandler

  • All Implemented Interfaces:
    LightHttpHandler, io.undertow.server.HttpHandler

    public class HealthGetHandler
    extends Object
    implements LightHttpHandler
    This is a server health handler that output OK to indicate the server is alive. Normally, it will be use by F5 to check if the server is health before route request to it. Another way to check server health is to ping the ip and port and it is the standard way to check server status for F5. However, the service instance is up and running doesn't mean it is functioning. This is the reason to provide a this handler to output more information about the server for F5 or maybe in the future for the API marketplace. Note that we only recommend to use F5 as reverse proxy for services with static IP addresses that act like traditional web server. These services will be sitting in DMZ to serve mobile native and browser SPA and aggregate other services in the backend. For services deployed in the cloud dynamically, there is no reverse proxy but using client side service discovery. TODO support cascade health check with configuration, for example, database etc.
    Author:
    Steve Hu
    • Field Detail

      • HEALTH_RESULT_OK_JSON

        public static final String HEALTH_RESULT_OK_JSON
    • Constructor Detail

      • HealthGetHandler

        public HealthGetHandler()
    • Method Detail

      • handleRequest

        public void handleRequest​(io.undertow.server.HttpServerExchange exchange)
                           throws Exception
        Specified by:
        handleRequest in interface io.undertow.server.HttpHandler
        Throws:
        Exception
      • reload

        public static void reload()