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本地主机: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....
推荐答案
这是在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屋!