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


##########
clients/src/main/java/org/apache/kafka/clients/producer/MockProducer.java:
##########
@@ -345,9 +343,11 @@ public synchronized Future<RecordMetadata> 
send(ProducerRecord<K, V> record, Cal
         if (!this.cluster.partitionsForTopic(record.topic()).isEmpty())
             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());
+            // Validate serializers if they are set

Review Comment:
   Would you please update the constructor javadoc to state that null 
serializers are supported?



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