Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
0.8.2.0
-
None
-
None
Description
When creating a ConsumerConfig from java.util.Properties, an IllegalArgumentException is thrown when the Properties instance is converted to a VerifiableProperties instance. To reproduce:
package com.test; import kafka.consumer.ConsumerConfig; import java.util.Properties; public class ContainsKeyTest { public static void main(String[] args) { Properties defaultProperties = new Properties(); defaultProperties.put("zookeeper.connect", "192.168.50.4:2181"); defaultProperties.put("zookeeper.session.timeout.ms", "400"); defaultProperties.put("zookeeper.sync.time.ms", "200"); defaultProperties.put("auto.commit.interval.ms", "1000"); defaultProperties.put("group.id", "consumerGroup"); Properties props = new Properties(defaultProperties); //prints 192.168.50.4:2181 System.out.println(props.getProperty("zookeeper.connect")); //throws java.lang.IllegalArgumentException: requirement failed: Missing required property 'zookeeper.connect' ConsumerConfig config = new ConsumerConfig(props); } }
This is easy enough to work around, but default Properties should be honored by not calling containsKey inside of kafka.utils.VerifiableProperties#getString
Attachments
Issue Links
- duplicates
-
KAFKA-3049 VerifiableProperties does not respect 'default' properties of underlying java.util.Properties instance
- Open