Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view kafka message

Tags:

apache-kafka

Is there any way I can view the message content sent to kafka for a given topic? Say some thing like view last 5 messages for this topic, if that it possible.

like image 930
Sandy Avatar asked May 29 '17 09:05

Sandy


People also ask

How do I see messages in Kafka tool?

Consuming from the topics in “Kafka tool”.In the tab “Properties” you can choose Key and message content type. If you added Avro plugin, as was described above you'll see Avro type as well. Choose the type used for your messages and go to the “Data” tab. Now you can see all messages that are in the selected topic.

How do I read the latest message from Kafka?

If you want to consume only the latest message from kafka topic, Please set “Auto Offset Reset” to “LATEST” and keep other values as default. If you want to consume all the message published from kafka topic Please set “Auto Offset Reset” to “EARLIEST” and keep other values as default.


2 Answers

You can use console consumer to view messages produced on some topic:

bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning 
like image 181
vatsal mevada Avatar answered Sep 26 '22 21:09

vatsal mevada


I work for a company with hundreds of developers who obviously need to check Kafka messages on a regular basis. Employees come and go and therefore we want to avoid the setup (dedicated SASL credentials, certificates, ACLs, ...) for each new employee.

Our platform teams operate a deployment of Kowl (https://github.com/cloudhut/kowl) so that everyone can access it without going through the usual setup. We also use it when developing locally using a docker-compose file.

Kowl Messages List

like image 28
kentor Avatar answered Sep 23 '22 21:09

kentor