Interface SchemaIdSerializer
- All Superinterfaces:
AutoCloseable,Closeable,org.apache.kafka.common.Configurable
- All Known Implementing Classes:
HeaderSchemaIdSerializer,PrefixSchemaIdSerializer
A
SchemaIdSerializer is used by a serializer to determine how to serialize schema
identifiers. It is invoked after the payload has been converted to bytes.-
Method Summary
-
Method Details
-
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.Configurable
-
serialize
byte[] serialize(String topic, boolean isKey, org.apache.kafka.common.header.Headers headers, byte[] payload, SchemaId schemaId) throws org.apache.kafka.common.errors.SerializationException Associates a schema identifier with the payload.- Parameters:
topic- topic associated with the payloadisKey- whether this is a record key or record valueheaders- headers associated with the record that can be mutated; may be empty.payload- serialized payload that does not include a schema identifierschemaId- schema identifier to be used; contains either an ID or GUID- Returns:
- the serialized payload that may include a schema identifier
- Throws:
org.apache.kafka.common.errors.SerializationException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-