Class DualSchemaIdDeserializer

java.lang.Object
io.confluent.kafka.serializers.schema.id.DualSchemaIdDeserializer
All Implemented Interfaces:
SchemaIdDeserializer, Closeable, AutoCloseable, org.apache.kafka.common.Configurable

public class DualSchemaIdDeserializer extends Object implements SchemaIdDeserializer
A DualSchemaIdDeserializer first looks for a schema GUID in the header; if not found it looks for a schema ID in the payload prefix.
  • Constructor Details

    • DualSchemaIdDeserializer

      public DualSchemaIdDeserializer()
  • Method Details

    • deserialize

      public ByteBuffer deserialize(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, SchemaId schemaId) throws org.apache.kafka.common.errors.SerializationException
      Description copied from interface: SchemaIdDeserializer
      Deserialize the payload and set the schema identifier.
      Specified by:
      deserialize in interface SchemaIdDeserializer
      Parameters:
      topic - topic associated with the payload
      isKey - whether this is a record key or record value
      headers - headers associated with the record; may be empty.
      payload - serialized payload that may include a schema identifier
      schemaId - schema identifier to be modified; either the ID or the GUID should be set
      Returns:
      the serialized payload that does not include a schema identifier
      Throws:
      org.apache.kafka.common.errors.SerializationException