muralibasani commented on code in PR #22467:
URL: https://github.com/apache/kafka/pull/22467#discussion_r3357068212


##########
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:
   And there is another occurrence here 
https://github.com/apache/kafka/blob/d559af58d8d0be113b6a96b6367a21b3e4d04197/clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java#L645



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

Reply via email to