Class PrefixSchemaIdDeserializer

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

public class PrefixSchemaIdDeserializer extends Object implements SchemaIdDeserializer
A PrefixSchemaIdDeserializer looks for a schema ID in the payload prefix.
  • Constructor Details

    • PrefixSchemaIdDeserializer

      public PrefixSchemaIdDeserializer()
  • 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