Producer.java

package com.favccxx.isoft.favkafka;
import java.util.Properties;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
 * Hello Producer
 * 
 * @author favccxx
 *
 */
public class Producers {
    private static Logger logger = LoggerFactory.getLogger(Producers.class);
    public static void main(String[] args) {
        try {
            // Get the Producer
            Properties props = new Properties();
            props.put("bootstrap.servers", "10.0.10.5:9092");
            props.put("acks", "all");
            props.put("retries", 0);
            props.put("batch.size