C0urante commented on code in PR #12010:
URL: https://github.com/apache/kafka/pull/12010#discussion_r853527225


##########
clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java:
##########
@@ -486,10 +488,14 @@ public class ConsumerConfig extends AbstractConfig {
                                         
CommonClientConfigs.METRIC_REPORTER_CLASSES_DOC)
                                 .define(KEY_DESERIALIZER_CLASS_CONFIG,
                                         Type.CLASS,
+                                        ConfigDef.NO_DEFAULT_VALUE,
+                                        new ConfigDef.NonNullValidator(),

Review Comment:
   Yes, I understand the motivation; I was wondering if we would automatically 
catch the case of null values when we'd defined the property with no default 
value.
   
   To answer my own question, an explicitly-set `null` in the original 
`Map<String, Object>` is not the same as having no value set at all, and since 
users can programmatically instantiate `KafkaConsumer` instances, it's possible 
that they may have specified `null` for the `key.deserializer` property and 
others like it. As a result, it is necessary to guard against null values for 
this property, either with preflight validation or downstream manual checks.



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