Class HeaderSchemaIdSerializer
java.lang.Object
io.confluent.kafka.serializers.schema.id.HeaderSchemaIdSerializer
- All Implemented Interfaces:
SchemaIdSerializer,Closeable,AutoCloseable,org.apache.kafka.common.Configurable
A
HeaderSchemaIdSerializer adds a schema GUID to the header.-
Constructor Details
-
HeaderSchemaIdSerializer
public HeaderSchemaIdSerializer()
-
-
Method Details
-
serialize
public byte[] serialize(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:SchemaIdSerializerAssociates a schema identifier with the payload.- Specified by:
serializein interfaceSchemaIdSerializer- 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
-