Interface SchemaIdDeserializer

All Superinterfaces:
AutoCloseable, Closeable, org.apache.kafka.common.Configurable
All Known Implementing Classes:
ConfigSchemaIdDeserializer, DualSchemaIdDeserializer, PrefixSchemaIdDeserializer

public interface SchemaIdDeserializer extends org.apache.kafka.common.Configurable, Closeable
A SchemaIdDeserializer is used by a deserializer to determine how to deserialize schema identifiers. It is invoked before the payload has been converted from bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
     
    default void
    configure(Map<String,?> configs)
     
    deserialize(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, SchemaId schemaId)
    Deserialize the payload and set the schema identifier.
  • Method Details

    • configure

      default void configure(Map<String,?> configs)
      Specified by:
      configure in interface org.apache.kafka.common.Configurable
    • deserialize

      ByteBuffer deserialize(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, SchemaId schemaId) throws org.apache.kafka.common.errors.SerializationException
      Deserialize the payload and set the schema identifier.
      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
    • close

      default void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException