if(hosts.length >= numProducer)
kafkaServerURL = hosts[i];
else
kafkaServerURL = hosts[random.nextInt(hosts.length)];
producers[i] = new Producer(topic,kafkaServerURL, kafkaServerPort, kafkaBufferSize, connectionTimeOut, reconnectInterval,
messageSize, InetAddress.getLocalHost().getHostAddress()+ producerName +i, batchSize,
numParts, compressionCodec);
}
// Start the threads