Interface LoadBalancerCheckProvider

All Superinterfaces:
Provider
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface LoadBalancerCheckProvider extends Provider
This interface is used for controlling load balancer. If one of the implementations reports that it is down, the load balancer endpoint will return the DOWN status.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    boolean
    Check if a component represented by this check is down/unhealthy.
  • Method Details

    • isDown

      boolean isDown()
      Check if a component represented by this check is down/unhealthy.

      The implementation must be non-blocking as it is executed in the event loop. It is necessary to run this in the event loop as blocking requests are queued and then the check would time out on the loadbalancer side when there is an overload situation in Keycloak. An automatic failover to the secondary site due to an overloaded primary site is desired as this could lead to a ping-pong between the sites where the primary site becomes available again once the switchover is complete.

      Returns:
      true if the component is down/unhealthy, false otherwise
    • close

      default void close()
      Specified by:
      close in interface Provider