Interface FallbackResolver

All Known Implementing Classes:
DefaultFallbackResolver, FileBasedFallbackResolver

public interface FallbackResolver
Resolves the canned response served when an origin call fails or its circuit is open. This is an extension point: front-cache.fallback-resolver.impl names the implementation and it is loaded by reflection, so an implementation can live outside this jar. Changed in 2.7: getFallbackConfigs(), which returned Map<domain, Set<FallbackConfigEntry>>, is now getFallbackEntries() returning the set directly. Multi-domain support was retired in 2.6, so that map had held exactly one entry ever since. The old method was REMOVED rather than kept as a deprecated default: a default would have let an implementation that still overrides only the old method compile and load, and then be silently ignored - and "silently ignored" for a fallback resolver means the wrong content at the exact moment the origin is already down. A compile error is the kinder failure. FallbackResolverFactory additionally refuses to load an implementation that lacks the new method, so a jar compiled against 2.6 and dropped in without recompiling fails at startup rather than with an AbstractMethodError on the first fallback.
  • Method Details

    • init

      void init(FcHttpClient client)
    • getFallback

      WebResponse getFallback(String fallbackSource, String urlStr)
    • getFallbackEntries

      Set<FallbackConfigEntry> getFallbackEntries()
      Returns:
      the configured fallback entries, for display in the console. Order matters: it is the order they are matched in, first match wins.