任何kafkaAPI 都运行报错,找了两天的问题
public static void main(String[] args) {
// 配置kafka的配置文件。
Properties properties = new Properties();
properties.put("metadata.broker.list", "master:9092");
properties.put("request.required.acks", "1");
properties.put("serializer.class", "kafka.serializer.StringEncoder");
Producer<Integer,String> producer = new Producer<Integer, String>(new ProducerConfig(properties));
KeyedMessage<In