You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2017/08/26 23:08:29 UTC
kafka git commit: KAFKA-5620: Expose the ClassCastException as the
cause for the SerializationException in KafkaProducer
Repository: kafka
Updated Branches:
refs/heads/trunk 551d57561 -> b01fcc3b8
KAFKA-5620: Expose the ClassCastException as the cause for the SerializationException in KafkaProducer
Expose the ClassCastException as the cause for the SerializationException.
Author: Jeremy Custenborder <jc...@gmail.com>
Reviewers: Guozhang Wang <wa...@gmail.com>
Closes #3556 from jcustenborder/KAFKA-5620
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/b01fcc3b
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/b01fcc3b
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/b01fcc3b
Branch: refs/heads/trunk
Commit: b01fcc3b89ee27940ca20dea00226d09a0ca0b8e
Parents: 551d575
Author: Jeremy Custenborder <jc...@gmail.com>
Authored: Sat Aug 26 16:08:24 2017 -0700
Committer: Guozhang Wang <wa...@gmail.com>
Committed: Sat Aug 26 16:08:24 2017 -0700
----------------------------------------------------------------------
.../java/org/apache/kafka/clients/producer/KafkaProducer.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/b01fcc3b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
index ba0d848..b06b415 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
@@ -768,7 +768,7 @@ public class KafkaProducer<K, V> implements Producer<K, V> {
} catch (ClassCastException cce) {
throw new SerializationException("Can't convert key of class " + record.key().getClass().getName() +
" to class " + producerConfig.getClass(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG).getName() +
- " specified in key.serializer");
+ " specified in key.serializer", cce);
}
byte[] serializedValue;
try {
@@ -776,7 +776,7 @@ public class KafkaProducer<K, V> implements Producer<K, V> {
} catch (ClassCastException cce) {
throw new SerializationException("Can't convert value of class " + record.value().getClass().getName() +
" to class " + producerConfig.getClass(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG).getName() +
- " specified in value.serializer");
+ " specified in value.serializer", cce);
}
int partition = partition(record, serializedKey, serializedValue, cluster);
tp = new TopicPartition(record.topic(), partition);