How to view kafka message

前端 未结 8 1319
既然无缘
既然无缘 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条回答
  •  梦毁少年i
    2021-02-01 12:43

    On server where your admin run kafka find kafka-console-consumer.sh by command find . -name kafka-console-consumer.sh then go to that directory and run for read message from your topic

    ./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic test --from-beginning --max-messages 10

    note that in topic may be many messages in that case I use --max-messages key

提交回复
热议问题