Class CanaryRouter

java.lang.Object
org.j7m.middleware.cluster.CanaryRouter

public final class CanaryRouter extends Object
Deterministic bounded identity routing; no request payload or identity is retained or exported.
  • Method Details

    • bucket

      public static int bucket(String scope, long revision, String requestId)
      Selects a release bucket from a scope, policy revision and stable request identity.
      Parameters:
      scope - authenticated routing namespace
      revision - policy revision
      requestId - stable application identity, at most 512 characters
      Returns:
      bucket in 0..9999
      Throws:
      IllegalArgumentException - for invalid identities or revision
    • node

      public static String node(String scope, long revision, String requestId, List<String> eligible)
      Selects a stable node from an already sorted, nonempty bounded eligible set.
      Parameters:
      scope - authenticated routing namespace
      revision - policy revision
      requestId - stable application identity
      eligible - sorted node identities, 1..64 entries
      Returns:
      selected node identity
      Throws:
      IllegalArgumentException - for invalid routing inputs