[ 
https://issues.apache.org/jira/browse/KAFKA-12391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17307893#comment-17307893
 ] 

Andrea Tarocchi commented on KAFKA-12391:
-----------------------------------------

I have used the proposed approach and I can confirm it is working.

That said I still regard this as a workaround because it rely on implementation 
details (i.e. being handled the very same record object to {{commitRecord}});
anyway the issue can be closed.

Thanks for the info and help [~ChrisEgerton]

> 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)

Reply via email to