我是Kafka的新人,我试着做这个例子https://github.com/smallnest/kafka-example-in-scala 我有Windows10,所以我也试着在这个网站上找到一些信息http://blog.anilot.tk/2014/08/06/set-up-kafka-on-windows/
我的问题从我试着管理这个制作人开始。
java -cp kafka_example-0.1.0-SNAPSHOT.jar com.colobu.kafka.ScalaProducerExample 10000 test_topic localhost:9092
在行乞时,我遇到了log4j的问题:
log4j:WARN no appenders could be found for logger kafka.utils.VerifiableProperties
log4j:Warn Please initialize the log4j system properly
sent per second: 129870
我在某个地方读到可以在命令行中添加以下内容:
-Dlog4j.configuration=file:///path/to/your/log4j.properties
这是工作,但我得到这样的东西:
[2016-07-17 12:39:17,567] INFO Verifying properties (kafka.utils.VerifiableProperties)
[2016-07-17 12:39:17,583] INFO Property metadata.broker.list is overridden to localhost:9092 (kafka.utils.VerifiableProperties)
[2016-07-17 12:39:17,583] INFO Property producer.type is overridden to async (kafka.utils.VerifiableProperties)
[2016-07-17 12:39:17,598] INFO Property serializer.class is overridden to kafka.serializer.StringEncoder (kafka.utils.VerifiableProperties)
[2016-07-17 12:39:17,645] WARN Can't read Kafka version from MANIFEST.MF. Possible cause: java.lang.NullPointerException (kafka.common.AppInfo$)
[2016-07-17 12:39:17,714] INFO Shutting down producer (kafka.producer.Producer)
[2016-07-17 12:39:17,730] INFO Begin shutting down ProducerSendThread (kafka.producer.async.ProducerSendThread)
[2016-07-17 12:39:17,730] INFO Fetching metadata from broker id:0,host:localhost,port:9092 with correlation id 0 for 1 topic(s) Set(test_topic) (kafka.client.ClientUtils$)
[2016-07-17 12:39:17,783] INFO Connected to localhost:9092 for producing (kafka.producer.SyncProducer)
[2016-07-17 12:39:17,799] INFO Disconnecting from localhost:9092 (kafka.producer.SyncProducer)
[2016-07-17 12:39:17,830] INFO Connected to MYNAMEPC:9092 for producing (kafka.producer.SyncProducer)
[2016-07-17 12:39:17,984] INFO Shutdown ProducerSendThread complete (kafka.producer.async.ProducerSendThread)
[2016-07-17 12:39:17,999] INFO Closing all sync producers (kafka.producer.ProducerPool)
[2016-07-17 12:39:17,999] INFO Disconnecting from MYNAMEPC:9092 (kafka.producer.SyncProducer)
[2016-07-17 12:39:17,999] INFO Producer shutdown completed in 285 ms (kafka.producer.Producer)
我试图找到解决办法,但我的努力没有成功。我将非常感激你的帮助。
暂无答案!
目前还没有任何答案,快来回答吧!