Message Formats
The library auto-resolves codecs for all built-in types at registration time — no manual override needed for most consumers:
| Type | Auto-resolved codec |
|---|---|
| Plain POJO (Jackson) | JsonMessageCodec |
String |
StringMessageCodec |
Avro SpecificRecord |
AvroMessageCodec |
Protobuf Message |
ProtoMessageCodec |
This applies symmetrically to both keys and values. For example, a consumer with <ShipmentKey, ShipmentEvent> (both POJOs) needs no codec overrides — the library detects both types and creates JsonMessageCodec instances automatically.
Explicit codec overrides
You can still override getKeyCodec() or getValueCodec() if needed (e.g. for custom formats). Explicit codecs take precedence over auto-resolution.
Avro
Requires org.apache.avro:avro on the classpath (declared as provided by the library).
Protobuf
Requires com.google.protobuf:protobuf-java and com.google.protobuf:protobuf-java-util on the classpath (both declared as provided).
Custom formats
Implement MessageCodec<T> directly for any format:
Then declare it on your consumer:
Key codec overrides
Keys are auto-resolved just like values. Override getKeyCodec() only when you need a custom codec: