Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This KIP proposes to bring a very similar header support to Kafka Connect.

Public Interfaces

Two new default methods will be added to the existing converter interface (connect/api/src/main/java/org/apache/kafka/connect/storage/Converter.java):

Code Block
languagejava
default byte[] fromConnectData(String topic, Headers headers, Schema schema, Object value) {
    return fromConnectData(topic, schema, value);
}

default SchemaAndValue toConnectData(String topic, Headers headers, byte[] value) {
    return toConnectData(topic, value);
}

Proposed Changes

Converter interface change as shown above. WorkerSinkTask and WorkerSourceTask will now provide headers to the fromConnectData/toConnectData methods.will have two new default methods described in the Public Interfaces section (above).

WorkerSinkTask will use the new toConnectData method and pass the headers from the message (both for keys and values). 

WorkerSourceTask will use the new fromConnectData method and pass the headers received from the headers converter (both for keys and values). 

Compatibility, Deprecation, and Migration Plan

...