mjsax commented on code in PR #15691:
URL: https://github.com/apache/kafka/pull/15691#discussion_r1614074321


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

Review Comment:
   > Although I'm not sure why... 🤔
   
   Because of backward compatibility. `RecordDeserializationException` is a 
public class, and thus, users could create objects (even if this class is not 
really intended for user to create objects, but usually only catch this 
exception -- users do all kind of things -- could also be some test code they 
write...), and thus we could break there code if we don't keep the old 
constructor.



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