Skip to content

(WIP) KAFKA-5142: Expose Record Headers in Kafka Connect (DO NOT MERGE)#2942

Closed
michaelandrepearce wants to merge 1 commit intoapache:trunkfrom
michaelandrepearce:KIP-145
Closed

(WIP) KAFKA-5142: Expose Record Headers in Kafka Connect (DO NOT MERGE)#2942
michaelandrepearce wants to merge 1 commit intoapache:trunkfrom
michaelandrepearce:KIP-145

Conversation

@michaelandrepearce
Copy link
Copy Markdown
Contributor

@michaelandrepearce michaelandrepearce commented Apr 29, 2017

as per KIP-145

Add constructors to Connect/Source/SinkRecord to take Iterable<Header>

add accessor method to ConnectRecord Headers headers()
Update WorkerSource/Sink to pass headers to/from Producer/ConsumerRecords

@asfbot
Copy link
Copy Markdown

asfbot commented Apr 29, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/3298/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Apr 29, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/3293/
Test PASSed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Apr 29, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3289/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/3412/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/3406/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3403/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/3413/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/3407/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3404/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3409/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/3418/
Test FAILed (JDK 8 and Scala 2.11).

Add ability to convert the headers data
new ConnectHeader that has header value schema
new SubjectConverter which allows exposing a subject, in this case the subject is the key. - this can be used to register the header type in repos like schema registry 
Add primitive subject converter that allows to configure header types, uses an in memory repo - this could be replace by a remote global repo ala schema repo.
@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/3411/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/3411/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/3420/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented May 3, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/3414/
Test FAILed (JDK 7 and Scala 2.10).

@michaelandrepearce michaelandrepearce changed the title KAFKA-5142: Expose Record Headers in Kafka Connect KAFKA-5142: Expose Record Headers in Kafka Connect (DO NOT MERGE) May 3, 2017
@michaelandrepearce michaelandrepearce changed the title KAFKA-5142: Expose Record Headers in Kafka Connect (DO NOT MERGE) (WIP) KAFKA-5142: Expose Record Headers in Kafka Connect (DO NOT MERGE) May 9, 2017
@rhauch
Copy link
Copy Markdown
Contributor

rhauch commented Oct 18, 2017

@michaelandrepearce, this is an interesting WIP proposal. Are you still working on this or interested in continuing this? I've got another #4077, though I'm not happy with it and it doesn't help much with on the sink side.

I think there are two semi-distinct aspects of headers. The first is simple serialization/deserialization, and here I think using AK's serializers and deserializers makes a lot of sense. (It would be good to also support Connect's converters for the complex types.)

The other challenge is conversion. Source connectors will generate headers each with a particular type, but that might not match what you want to have in your Kafka topics. Sink connectors will also likely expect headers with particular types, but again that might not match what you have in your messages. We could handle this conversion with SMTs, but SMTs are complicated, and it'd be interesting if Connect could provide support for conversion at the connector-level. Either way, it seems like this conversion step is going to be pretty important -- the challenge is whether it will be possible to convert between types. Numbers and Strings are kinda obvious, but conversion with other types maybe not so much.

Anyway, nice work so far. Hope you're willing to continue the discussion!

@michaelandrepearce
Copy link
Copy Markdown
Contributor Author

@rhauch this was to compliment a kip, and the discussion.

https://cwiki.apache.org/confluence/display/KAFKA/KIP-145+-+Expose+Record+Headers+in+Kafka+Connect

The kip is paused as not many supported it at the time.

I’m happy to re pick up but need the support on the kip via the mail lists (eg +1’s) . Please re ignite the kip discussion on the mailing lists, and I’d be more than happy finishing this work off.

@michaelandrepearce
Copy link
Copy Markdown
Contributor Author

@rhauch was working on my phone, and put my reply to why this approach with serdes/converters on your pr accident as had it open. I’m sure you’ll pick it up :)

@hachikuji
Copy link
Copy Markdown
Contributor

Closing since this was resolved by #4319.

@hachikuji hachikuji closed this Feb 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants