alexeyt820 commented on a change in pull request #6615: [FLINK-8354] 
[flink-connectors] Add ability to access and provider Kafka headers
URL: https://github.com/apache/flink/pull/6615#discussion_r257903161
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedSerializationSchema.java
 ##########
 @@ -55,4 +57,13 @@
         * @return null or the target topic
         */
        String getTargetTopic(T element);
+
+       /**
+        *
+        * @param element The incoming element to be serialized
+        * @return collection of headers (maybe empty)
+        */
+       default Iterable<Map.Entry<String, byte[]>> headers(T element) {
 
 Review comment:
   I didn't plan to introduce `KafkaDeserialisationSchema`, current approach 
with default method is simpler, but if you think that it is important to have 
symmetrical API, I can do it. Let me know.
   
   I don't like idea of splitting into two PRs, currently added tests produce 
records with headers and consumes them. I feel splitting will add extra 
complexity at least from unit test standpoint. And for my purposes I need both 
- consumer and producer with headers.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to