Class InfinispanMultiSiteLoadBalancerCheckProvider

java.lang.Object
org.keycloak.connections.infinispan.InfinispanMultiSiteLoadBalancerCheckProvider
All Implemented Interfaces:
LoadBalancerCheckProvider, Provider

public class InfinispanMultiSiteLoadBalancerCheckProvider extends Object implements LoadBalancerCheckProvider
  • Constructor Details

    • InfinispanMultiSiteLoadBalancerCheckProvider

      public InfinispanMultiSiteLoadBalancerCheckProvider(InfinispanConnectionProvider connectionProvider)
  • Method Details

    • isDown

      public boolean isDown()
      Non-blocking check if all caches and their persistence are available.

      In a situation where any cache's remote cache is unreachable, this will report the "down" to the caller. When the remote cache is down, it assumes that it is down for all Keycloak nodes in this site, all incoming requests are likely to fail and that a loadbalancer should send traffic to the other site that might be healthy.

      This code is non-blocking as the embedded Infinispan checks the connection to the remote store periodically in the background (default: every second). See LoadBalancerCheckProvider.isDown() to read more why this needs to be non-blocking.

      Specified by:
      isDown in interface LoadBalancerCheckProvider
      Returns:
      true if the component is down/unhealthy, false otherwise
    • close

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