apache-kafka

How to view Kafka messages?


Is there any way I can view the message content sent to Kafka for a given topic? Say something like viewing this topic's last five messages, if possible.


Solution

  • 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