[ https://issues.apache.org/jira/browse/KAFKA-12391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295445#comment-17295445 ]
Chris Egerton commented on KAFKA-12391: --------------------------------------- SMTs shouldn't interfere with option 2; both times {{SourceTask::commitRecord}} is invoked, it's done with the pre-transform record: [https://github.com/apache/kafka/blob/be1476869fc93553b3099d387d26bfd0092a9d65/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java#L382,] [https://github.com/apache/kafka/blob/be1476869fc93553b3099d387d26bfd0092a9d65/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java#L345.|https://github.com/apache/kafka/blob/be1476869fc93553b3099d387d26bfd0092a9d65/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java#L345] > Add an option to store arbitrary metadata to a SourceRecord > ----------------------------------------------------------- > > Key: KAFKA-12391 > URL: https://issues.apache.org/jira/browse/KAFKA-12391 > Project: Kafka > Issue Type: Improvement > Components: KafkaConnect > Reporter: Luca Burgazzoli > Priority: Minor > > When writing Source Connectors for Kafka, it may be required to perform some > additional house cleaning when an record has been acknowledged by the Kafka > broker and as today, it is possible to set up an hook by overriding > SourceTask.commitRecord(SourceRecord). > This works fine in most of the cases but to make it easy for the source > connector to perform it's internal house keeping, it would be nice to have an > option to set some additional metadata to the SourceRecord without having > impacts to the Record sent to the Kafka Broker, something like: > {code:java} > class SourceRecord { > public SourceRecord( > ..., > Map<String, ?> attributes) { > ... > this.attributes = attributes; > } > Map<String, ?> attributes() { > return attributes; > } > } > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005)