本文主要是介绍kafka - The type scala.ScalaObject cannot be resolved.,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
初学者kafka的java客户端遇到了一个问题。
public class SimpleKafkaProducer {private static final Logger logger = Logger.getLogger(SimpleKafkaProducer.class);private void execMsgSend() {Properties props = new Properties();props.put("metadata.broker.list", "192.168.70.181:9092");props.put("serializer.class", "kafka.serializer.StringEncoder");props.put("key.serializer.class", "kafka.serializer.StringEncoder");props.put("request.required.acks", "0");ProducerConfig config = new ProducerConfig(props); logger.info("set config info(" + config + ") ok.");Producer<String, String> procuder = new Producer<>(config);String topic = "mytopic&
这篇关于kafka - The type scala.ScalaObject cannot be resolved.的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!