muralibasani commented on code in PR #22467:
URL: https://github.com/apache/kafka/pull/22467#discussion_r3357066084
##########
clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java:
##########
@@ -344,8 +344,10 @@ public synchronized Future<RecordMetadata>
send(ProducerRecord<K, V> record, Cal
partition = partition(record, this.cluster);
else {
//just to throw ClassCastException if serializers are not the
proper ones to serialize key/value
- keySerializer.serialize(record.topic(), new RecordHeaders(),
record.key());
- valueSerializer.serialize(record.topic(), new RecordHeaders(),
record.value());
+ if (keySerializer != null)
Review Comment:
Can you also add a test to MockProducerTest that no npe is thrown from
default 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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]