KAFKA-7273: extend Connect Converter to support headers#6362
KAFKA-7273: extend Connect Converter to support headers#6362rhauch merged 7 commits intoapache:trunkfrom
Conversation
ryannedolan
left a comment
There was a problem hiding this comment.
I don't think this change makes sense, and also duplicates an existing API. See HeaderConverter and KIP-145.
https://cwiki.apache.org/confluence/display/KAFKA/KIP-145+-+Expose+Record+Headers+in+Kafka+Connect
HeaderConverter handles use-case when you need to transform headers. I don't want to transform them, I simply want to get access to the headers in my converter, together with the payload. |
|
Hey @ewencp, @hachikuji, any chance you can take a look? Thanks |
ewencp
left a comment
There was a problem hiding this comment.
Left one (major) comment. Didn't review rest in detail, but most looks straightforward and reasonable -- with the caveat that this particular direction warrants much broader review.
|
@sap1ens regarding KIPs:
Many folks are happy to help guide through KIP process (which can be pretty easy in some cases, but tbh I suspect this case will require some significant discussion and thought!). Off the top of my head, @kkonstantine @rhauch @wicknicks @rayokota can probably review and help with guidance on KIP and design. |
|
Suggest adding unit tests to ensure headers are preserved. |
|
@ewencp @kkonstantine @rhauch @wicknicks @rayokota any chance you help with the KIP review for this? Discussion thread has been created https://lists.apache.org/thread.html/1fc1e3d2cddd8311d3db7c98f0d09a1a137ca4b20d1f3c8ab203a855@%3Cdev.kafka.apache.org%3E |
a968e91 to
3d019fa
Compare
|
KIP has been accepted. I've pushed another commit with extra tests. |
ryannedolan
left a comment
There was a problem hiding this comment.
I'd like to see a unit tests that covers the scenario described as motivation in the KIP, where serde is influenced by some header field (rather than just passed through).
rhauch
left a comment
There was a problem hiding this comment.
Looks pretty good, though I have a few comments / suggestions below.
|
@ryannedolan @rhauch thanks for the feedback so far, I've addressed it with commit 009212c |
|
I've also had to suppress |
|
@ryannedolan @rhauch hi, just wanted to check if you have time to take a look at the latest changes, thanks! |
ryannedolan
left a comment
There was a problem hiding this comment.
thanks for the improved tests, lgtm
rhauch
left a comment
There was a problem hiding this comment.
Overall this is really good. My only concern is the use of Java serialization, which would be good to avoid because of the security implications, even if it's only used in test code.
|
@sap1ens yes, this looks good. Please resolve conflicts and ping me again. Thanks! |
# Conflicts: # connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerSourceTaskTest.java
|
@rhauch merge conflict has been resolved, this PR is ready. |
|
Failed test seems to be completely unrelated (flaky integration test perhaps?):
|
|
This PR does not change all of the uses of the older
However, I think this is perfectly acceptable for a couple of reasons: changing those would increase the size of this PR, while leaving them as-is helps verify backward compatibility of converters that only implement the older methods. The PR does change the important call sites in |
Conflicts: * .gitignore: addition of clients/src/generated-test was near local additions for support-metrics. * checkstyle/suppressions.xml: upstream refactoring of exclusions for generator were near the local changes for support-metrics. * gradle.properties: scala version bump caused a minor conflict due to the kafka version change locally. gradle/dependencies.gradle: bcpkix version bump was near avro additions in the local version. * apache-github/trunk: (49 commits) KAFKA-8471: Replace control requests/responses with automated protocol (apache#7353) MINOR: Don't generate unnecessary strings for debug logging in FetchSessionHandler (apache#7394) MINOR:fixed typo and removed outdated varilable name (apache#7402) KAFKA-8934: Create version file during build for Streams (apache#7397) KAFKA-8319: Make KafkaStreamsTest a non-integration test class (apache#7382) KAFKA-6883: Add toUpperCase support to sasl.kerberos.principal.to.local rule (KIP-309) KAFKA-8907; Return topic configs in CreateTopics response (KIP-525) (apache#7380) MINOR: Address review comments for KIP-504 authorizer changes (apache#7379) MINOR: add versioning to request and response headers (apache#7372) KAFKA-7273: Extend Connect Converter to support headers (apache#6362) MINOR: improve the Kafka RPC code generator (apache#7340) MINOR: Improve the org.apache.kafka.common.protocol code (apache#7344) KAFKA-8880: Docs on upgrade-guide (apache#7385) KAFKA-8179: do not suspend standby tasks during rebalance (apache#7321) KAFKA-8580: Compute RocksDB metrics (apache#7263) KAFKA-8880: Add overloaded function of Consumer.committed (apache#7304) HOTFIX: fix Kafka Streams upgrade note for broker backward compatibility (apache#7363) KAFKA-8848; Update system tests to use new AclAuthorizer (apache#7374) MINOR: remove unnecessary null check (apache#7299) KAFKA-6958: Overload methods for group and windowed stream to allow to name operation name using the new Named class (apache#6413) ...
Update: See KIP-440, approved.
Extending
Converterinterface to support headers in backwards-compatible way. Very similar to Serializer and Deserializer interfaces.A few questions I have to the contributors:
Is KIP required in this case? Converter is a public interface, but the change is trivial and backwards-compatible.CreatedCommitter Checklist (excluded from commit message)