Reputation: 9
I have a Kafka producer in java application and I used to consume messages from Kafka Server without any problems.
But suddenly I cant run the command kafka-console-consumer.bat
in the command prompt. It doesn't display any error message.
D:\Software\kafka_2.13-3.3.1>kafka-console-consumer.bat
D:\Software\kafka_2.13-3.3.1>
I have tried to consume message from the Kafka server through the command
kafka-console-consumer.bat --bootstrap-server localhost:9092 --from-beginning --topic student-details
But the command is not working. Is there any alternative way to consume messages
Upvotes: 0
Views: 541
Reputation: 1
I had the same issue. At the end, issue was that "kafka-console-consumer.bat" file was 0 bytes. During installation process or in some other way, kafka-console-consumer.bat file becomes empty.
So, when you run the .bat file, it doesn't do anything. After copying the file from source (zip file) again, it worked well.
Upvotes: 0
Reputation: 191983
The alternative is to write code for a consumer, or use any other tool available. I prefer kcat
on the CLI.
To debug your problem, you could edit Kafka's log4j.properties to increase the log level of the consumer.
Or, depending on how much time elapsed between "now", and "working perfectly", your topic is empty.
Upvotes: 0