AvroPayloadDeserializer

Thin Kotlin wrapper around Confluent's KafkaAvroDeserializer configured with the Schema Registry URL taken from KafkaInfraProperties and specific.avro.reader=true so the returned value is the generated SpecificRecord subclass (and not a generic record).

Paired with AvroPayloadSerializer; together they let any consumer of the shared infrastructure work with raw ByteArray payloads on the wire while still benefiting from Schema-Registry-backed Avro typing in application code.

Constructors

Link copied to clipboard
constructor(properties: KafkaInfraProperties)

Functions

Link copied to clipboard
fun deserialize(topic: String, payload: ByteArray): Any

Deserializes the Confluent Avro wire-format payload received from topic. The returned value is a SpecificRecord subclass when one is on the classpath, otherwise a GenericRecord.