tzulitai commented on a change in pull request #6105: [FLINK-8500] Get the 
timestamp of the Kafka message from kafka consumer
URL: https://github.com/apache/flink/pull/6105#discussion_r211187832
 
 

 ##########
 File path: 
flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/util/serialization/KeyedDeserializationSchema.java
 ##########
 @@ -45,6 +45,22 @@
         */
        T deserialize(byte[] messageKey, byte[] message, String topic, int 
partition, long offset) throws IOException;
 
+       /**
+        * Deserializes the byte message.
+        *
+        * @param messageKey the key as a byte array (null if no key has been 
set).
+        * @param message The message, as a byte array (null if the message was 
empty or deleted).
+        * @param partition The partition the message has originated from.
+        * @param offset the offset of the message in the original source (for 
example the Kafka offset).
+        * @param timestamp the timestamp of the consumer record
+        * @param timestampType The timestamp type, could be NO_TIMESTAMP, 
CREATE_TIME or INGEST_TIME.
+        *
+        * @return The deserialized message as an object (null if the message 
cannot be deserialized).
+        */
+       default T deserialize(byte[] messageKey, byte[] message, String topic, 
int partition, long offset, long timestamp, TimestampType timestampType) throws 
IOException {
 
 Review comment:
   @FredTing Your first concern makes sense. Though, wouldn't this be a 
shortcoming also for our long-term solution, where we want to have separate 
interfaces for "deserialization" and "enrichment"?
   
   ```
   I have no problem with the first alternative, but I think we are better of 
when we throw an exception with a message explaining that must 
implement/override one of the deserialize methods.
   ```
   
   I'm not sure how this would work. Could you elaborate a bit more on this?

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