public class SimpleHeaderConverter extends Object implements HeaderConverter
HeaderConverter that serializes header values as strings and that deserializes header values to the most appropriate
numeric, boolean, array, or map representation. Schemas are not serialized, but are inferred upon deserialization when possible.| Constructor and Description |
|---|
SimpleHeaderConverter() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
ConfigDef |
config()
Configuration specification for this set of header converters.
|
void |
configure(Map<String,?> configs)
Configure this class with the given key-value pairs
|
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. |
public ConfigDef config()
HeaderConverterconfig in interface HeaderConverterpublic void configure(Map<String,?> configs)
Configurableconfigure in interface Configurablepublic SchemaAndValue toConnectHeader(String topic, String headerKey, byte[] value)
HeaderConverterHeader object.toConnectHeader in interface HeaderConvertertopic - 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 nullpublic byte[] fromConnectHeader(String topic, String headerKey, Schema schema, Object value)
HeaderConverterfromConnectHeader in interface HeaderConvertertopic - 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 nullpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException