public interface HeaderConverter extends Configurable, Closeable
Converter interface, but specifically for
Headers.
Kafka Connect may discover implementations of this interface using the Java ServiceLoader mechanism.
To support this, implementations of this interface should also contain a service provider configuration file in
META-INF/services/org.apache.kafka.connect.storage.HeaderConverter.
| Modifier and Type | Method and Description |
|---|---|
ConfigDef |
config()
Configuration specification for this set of header converters.
|
byte[] |
fromConnectHeader(String topic,
String headerKey,
Schema schema,
Object value)
|
SchemaAndValue |
toConnectHeader(String topic,
String headerKey,
byte[] value)
Convert the header name and byte array value into a
Header object. |
configureSchemaAndValue toConnectHeader(String topic, String headerKey, byte[] value)
Header object.topic - the name of the topic for the record containing the headerheaderKey - the header's key; may not be nullvalue - the header's raw value; may be nullSchemaAndValue; may not be nullbyte[] fromConnectHeader(String topic, String headerKey, Schema schema, Object value)
topic - the name of the topic for the record containing the headerheaderKey - the header's key; may not be nullschema - the schema for the header's value; may be nullvalue - the header's value to convert; may be nullConfigDef config()