Class ConfluentWireCompatSchemaRegistryClient

java.lang.Object
com.aim2be.platform.schema.ConfluentWireCompatSchemaRegistryClient
All Implemented Interfaces:
SchemaRegistryClient

public class ConfluentWireCompatSchemaRegistryClient extends Object implements SchemaRegistryClient
Confluent wire-format compatibility client (ADR-0011 §B fallback hedge).

Talks to an Apicurio registry under the hood — same v2 REST API, same artifact storage — but advertises WireFormat.CONFLUENT_4_BYTE as its on-wire prefix. Producers built on top of this client emit records using Confluent's 0x00 magic + 4-byte schemaId layout instead of Apicurio's 8-byte globalId prefix.

This is the "Confluent if missed" hedge from .planning/26-stage-b-outbox-parity.md §0 row L-19: if ADR-0011 §B is overridden later and aim2be needs to stay wire-compatible with existing Confluent consumers, switching every producer is a 1-bean config change (im2be.schema-registry.mode=confluent) rather than a code rewrite.

Behaviour delta vs ApicurioSchemaRegistryClient:

Note: Apicurio's globalId is a long and Confluent's schemaId is an int. The platform's choice (per ADR-0011 §B) is to widen the Confluent id to long at the SchemaRegistryClient boundary; downstream producer encoders narrow back to int via WireFormatCodec.prependConfluentPrefix(int, byte[]) after a range check. Operators must keep the registry's id allocator within the 31-bit positive int range during the period this mode is active.