Kafka:消费者不消费来自命令行的消息 [英] Kafka:consumer not consuming messages from commandline
问题描述
D:\Softwares\kafka\kafka_2.10-0.10.0.1\bin\windows>kafka-console-consumer.bat --zookeeper localhost:2181 --topic sampletopic
D:\Softwares\kafka\kafka_2.10-0.10.0.1\bin\windows>kafka-console-consumer.bat --zookeeper localhost:2181 --topic sampletopic
我使用上面的命令来消费消息,有什么我遗漏的吗?帮助我:
I used above command to consume the messages, is there anything I have missed? Help me on:
这个
那些是生产者和消费者......
those are producer and consumer....
推荐答案
This is on Windows 10
This is on Windows 10
我知道这已经很老了,但如果其他人来这里寻找答案,问题可能是 kafka-console-consumer.bat 是空的,因为它对我来说是空的.我在做
I know this is very old but in case someone else comes in here looking for an answer, the issue could be that kafka-console-consumer.bat is empty as it was for me. I was doing
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic myTopic
并且命令行中不会发生任何事情,就像问这个问题的人一样,直到我发现我尝试运行的脚本文件中没有任何内容.我找到了其他人,他们的内容完好无损,只是复制并粘贴了内容.
and nothing would happen in the command line, same as to the person who asked this question, until I figured out the script file I'm trying to run has nothing in it. I found someone else who had theirs intact and just copied and pasted the contents in.
我不明白这个文件是怎么变空的,但在某些时候,我删除了它并尝试了很多方法来解决这个问题后,我无法发布一个主题,也许这是在不知何故的时候脚本文件被清除.
I don't understand how this file got empty but at some point, I couldn't get a topic to be released after I had deleted it and had tried a lot of things to fix this and perhaps this is when somehow that script file got cleared out.
这篇关于Kafka:消费者不消费来自命令行的消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!