使用
kaf
1.安装kaf
go install github.com/birdayz/kaf/cmd/kaf@latest
2.命令
Add a local Kafka with no auth
kaf config add-cluster local -b localhost:19192
Select cluster from dropdown list
kaf config select-cluster
Describe and List nodes
kaf node ls
List topics, partitions and replicas
kaf topics
Describe a given topic called mqtt.messages.incoming
kaf topic describe mqtt.messages.incoming
List consumer groups
kaf groups
Describe a given consumer group called dispatcher
kaf group describe dispatcher
创建一个topic
kaf topic create topic1 -p 1 -r 1
发送消息到topic
echo '{"time" : "2020-12-18T03:38:39.000Z", "name" : "name1", "value" : 1}' | kaf -b '127.0.0.1:19192' produce topic1
消费一个topic
kaf consume topic1