Enum Class RegisterMode

java.lang.Object
java.lang.Enum<RegisterMode>
io.krabka.streams.schema.RegisterMode
All Implemented Interfaces:
Serializable, Comparable<RegisterMode>, Constable

public enum RegisterMode extends Enum<RegisterMode>
Defines how prewarming resolves a schema ID.

SchemaCache.prewarm() resolves every interned subject to a schema ID by talking to the registry once. The mode chooses the registry operation used for that resolution.

Example

// Production: never create new schema versions from application startup.
var cache = new SchemaCache(client, RegisterMode.LOOKUP_ONLY, new TopicNameStrategy());
serde.registerSubject("orders");
cache.prewarm().join();
  • Enum Constant Details

    • AUTO_REGISTER

      public static final RegisterMode AUTO_REGISTER
      Registers the local schema, creating a new subject version when the schema is unknown to the registry. Registration is idempotent: re-registering an existing schema returns its existing ID.
    • LOOKUP_ONLY

      public static final RegisterMode LOOKUP_ONLY
      Looks the local schema up under the subject and fails prewarming when the registry does not already know it. Use this in environments where schemas are registered by a deployment pipeline rather than by applications.
    • USE_LATEST

      public static final RegisterMode USE_LATEST
      Uses the latest registered version of the subject regardless of the local schema text. The writer schema recorded for the resolved ID is still the local schema, so the local and latest schemas must be compatible.
  • Method Details

    • values

      public static RegisterMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RegisterMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null