Enum Class WireFormat

java.lang.Object
java.lang.Enum<WireFormat>
com.aim2be.platform.schema.WireFormat
All Implemented Interfaces:
Serializable, Comparable<WireFormat>, Constable

public enum WireFormat extends Enum<WireFormat>
On-wire schema-ID prefix encoding (ADR-0011 §B).

Kafka records carrying schema-registered payloads must declare WHICH schema produced their bytes. Two industry conventions exist:

  • APICURIO_8_BYTE — Apicurio's native layout: [globalId : 8 bytes big-endian] followed by the payload. Selected when the producer talks to an Apicurio registry directly and consumers know to skip 8 bytes before decoding.
  • CONFLUENT_4_BYTE — Confluent's legacy layout: [0x00 magic][schemaId : 4 bytes big-endian] followed by the payload. Selected when the producer needs to be wire-compatible with existing Confluent serdes on the consumer side (the OBJ-71 hedge from .planning/26-stage-b-outbox-parity.md §0 row L-19).

Per ADR-0011 §B the platform defaults to APICURIO_8_BYTE; the 4-byte variant is the "Confluent if missed" fallback the registry decision left open. Switching all producers between formats is a 1-bean config change in SchemaRegistryAutoConfiguration, not a code rewrite.

  • Enum Constant Details

    • APICURIO_8_BYTE

      public static final WireFormat APICURIO_8_BYTE
      Apicurio native: 8-byte big-endian globalId prefix.
       +--------+--------+--------+--------+--------+--------+--------+--------+----------+
       |               globalId : long (big-endian, 8 bytes)               | payload... |
       +--------+--------+--------+--------+--------+--------+--------+--------+----------+
       
    • CONFLUENT_4_BYTE

      public static final WireFormat CONFLUENT_4_BYTE
      Confluent legacy: 0x00 magic byte + 4-byte big-endian schemaId.
       +--------+--------+--------+--------+--------+----------+
       |  0x00  |    schemaId : int (big-endian, 4 bytes)    | payload... |
       +--------+--------+--------+--------+--------+----------+
       
  • Method Details

    • values

      public static WireFormat[] 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 WireFormat 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