How to view kafka message

前端 未结 8 1335
既然无缘
既然无缘 2021-02-01 12:10

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.

8条回答
  •  一个人的身影
    2021-02-01 12:40

    Use the Kafka consumer provided by Kafka :

    bin/kafka-console-consumer.sh --bootstrap-server BROKERS --topic TOPIC_NAME
    

    It will display the messages as it will receive it. Add --from-beginning if you want to start from the beginning.

提交回复
热议问题