Enum Class RegisterMode
- All Implemented Interfaces:
Serializable, Comparable<RegisterMode>, Constable
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();
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRegisters the local schema, creating a new subject version when the schema is unknown to the registry.Looks the local schema up under the subject and fails prewarming when the registry does not already know it.Uses the latest registered version of the subject regardless of the local schema text. -
Method Summary
Modifier and TypeMethodDescriptionstatic RegisterModeReturns the enum constant of this class with the specified name.static RegisterMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
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
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
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
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
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 nameNullPointerException- if the argument is null
-