Index: core/src/main/scala/kafka/producer/Producer.scala =================================================================== --- core/src/main/scala/kafka/producer/Producer.scala (revision 1294923) +++ core/src/main/scala/kafka/producer/Producer.scala (working copy) @@ -33,8 +33,6 @@ /* use the other constructor*/ extends Logging { private val hasShutdown = new AtomicBoolean(false) - if(!Utils.propertyExists(config.zkConnect) && !Utils.propertyExists(config.brokerList)) - throw new InvalidConfigException("At least one of zk.connect or broker.list must be specified") if (Utils.propertyExists(config.zkConnect) && Utils.propertyExists(config.brokerList)) warn("Both zk.connect and broker.list provided (zk.connect takes precedence).") private val random = new java.util.Random Index: core/src/main/scala/kafka/producer/ProducerConfig.scala =================================================================== --- core/src/main/scala/kafka/producer/ProducerConfig.scala (revision 1294923) +++ core/src/main/scala/kafka/producer/ProducerConfig.scala (working copy) @@ -29,11 +29,11 @@ * to pass in static broker and per-broker partition information. Format- * * brokerid1:host1:port1, brokerid2:host2:port2*/ val brokerList = Utils.getString(props, "broker.list", null) - if(brokerList != null && Utils.getString(props, "partitioner.class", null) != null) + if(Utils.propertyExists(brokerList) && Utils.getString(props, "partitioner.class", null) != null) throw new InvalidConfigException("partitioner.class cannot be used when broker.list is set") /** If both broker.list and zk.connect options are specified, throw an exception */ - if(brokerList != null && zkConnect != null) + if(Utils.propertyExists(brokerList) && Utils.propertyExists(zkConnect)) throw new InvalidConfigException("only one of broker.list and zk.connect can be specified") /** the partitioner class for partitioning events amongst sub-topics */