fred-ro commented on code in PR #15691:
URL: https://github.com/apache/kafka/pull/15691#discussion_r1561426507


##########
clients/src/main/java/org/apache/kafka/common/errors/RecordDeserializationException.java:
##########
@@ -16,29 +16,38 @@
  */
 package org.apache.kafka.common.errors;
 
+import org.apache.kafka.clients.consumer.ConsumerRecord;
 import org.apache.kafka.common.TopicPartition;
 
+
 /**
  *  This exception is raised for any error that occurs while deserializing 
records received by the consumer using 
  *  the configured {@link org.apache.kafka.common.serialization.Deserializer}.
  */
 public class RecordDeserializationException extends SerializationException {
 
-    private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 2L;
     private final TopicPartition partition;
-    private final long offset;
+    private final ConsumerRecord<byte[], byte[]> consumerRecord;
 
-    public RecordDeserializationException(TopicPartition partition, long 
offset, String message, Throwable cause) {
+    public RecordDeserializationException(TopicPartition partition,
+                                          ConsumerRecord<byte[], byte[]> 
record,
+                                          String message,
+                                          Throwable cause) {
         super(message, cause);
         this.partition = partition;
-        this.offset = offset;
+        this.consumerRecord = record;
     }
 
     public TopicPartition topicPartition() {
         return partition;
     }
 
     public long offset() {
-        return offset;
+        return consumerRecord.offset();
+    }
+
+    public ConsumerRecord<byte[], byte[]> getConsumerRecord() {

Review Comment:
   Now compliant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to