Class FcResilienceRegistry

java.lang.Object
org.frontcache.resilience.FcResilienceRegistry

public class FcResilienceRegistry extends Object
Holds the Resilience4j registries, keyed by command key. Separate from FcCommand so the metrics stream can read circuit state without constructing a command, and separate from FcCommandMetrics because the two have different lifetimes: the registries are configuration, the metrics are a rolling window. Registry entries are named by command key alone, which is only correct because one node serves one site. Before multi-domain support was retired, Hystrix's per-commandKey circuit breakers were shared across every domain on an edge - one tenant's failing origin short-circuited every other tenant's healthy one. That fault is now structurally impossible rather than fixed; proposal section 6.6 records it, and the composite naming it would need if multi-tenancy ever returns.
  • Method Details

    • circuitBreaker

      public static io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker(FcCommandConfig config)
    • bulkhead

      public static io.github.resilience4j.bulkhead.Bulkhead bulkhead(FcCommandConfig config)
    • timeLimiter

      public static io.github.resilience4j.timelimiter.TimeLimiter timeLimiter(FcCommandConfig config)
    • circuitBreakerRegistry

      public static io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry circuitBreakerRegistry()
      The registries themselves, for the Micrometer binders in org.frontcache.metrics. Exposed rather than re-wrapped: resilience4j-micrometer binds to a registry and picks up entries added later, which is what makes a command that starts serving after startup show up on its own.
    • bulkheadRegistry

      public static io.github.resilience4j.bulkhead.BulkheadRegistry bulkheadRegistry()
    • timeLimiterRegistry

      public static io.github.resilience4j.timelimiter.TimeLimiterRegistry timeLimiterRegistry()
    • existingCircuitBreaker

      public static io.github.resilience4j.circuitbreaker.CircuitBreaker existingCircuitBreaker(String commandKey)
      The breaker for a command key if one was ever created, else null. The metrics stream uses this for isCircuitBreakerOpen - reading live state rather than tracking a copy.
    • invalidateAll

      public static void invalidateAll()
      Forgets every breaker, bulkhead and time limiter, so the next command builds its own from the config that is current then. This drops circuit state. An open breaker snaps closed and every rolling window restarts at zero, which is visible on the realtime page as a step change. That is the cost of applying a changed resilience.properties without a restart, and FcResilienceReload reports it rather than leaving the operator to infer it - a breaker whose configuration just changed has no meaningful accumulated history anyway.