How to view kafka message

前端 未结 8 1306
既然无缘
既然无缘 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:32

    Old version includes kafka-simple-consumer-shell.sh (https://kafka.apache.org/downloads#1.1.1) which is convenient since we do not need cltr+c to exit.

    For example

    kafka-simple-consumer-shell.sh --broker-list $BROKERIP:$BROKERPORT --topic $TOPIC1 --property print.key=true --property key.separator=":"  --no-wait-at-logend
    

提交回复
热议问题