Run go install
from cmd/kaf
directory
The Hinge fork has additional features for working with Confluent and Debezium Schema Header messages. It supports consuming and producing with Confluent Schema Headers, and comsuming messages with Debezium schema headers.
See below/command help for general usage instructions. This section focuses on use cases involving functionality that has been added in the fork.
kaf --cluster $cluster consume $topicname --proto-include /path/to/protobufs/ --proto-type $protoname --trim-message-header-bytes 6
kaf --cluster $cluster consume $topicname --trim-message-header-bytes 5 --trim-key-header-bytes 5
kaf --cluster $cluster query $topicname --key $querykey --proto-include /path/to/protobufs/ --proto-type $protoname --trim-message-header-bytes 6
kaf --cluster $cluster produce $topicname --schema-registry-type confluent --schema-registry-key $schemakey --schema-registry-secret $schemasecret --schema-registry-url $schemaurl --proto-include /path/to/protobufs/ --proto-type $protoname --key $msgkey
Kafka CLI inspired by kubectl & docker
Install via Go from source:
go install github.com/birdayz/kaf/cmd/kaf@latest
Install via install script:
curl https://raw.githubusercontent.com/birdayz/kaf/master/godownloader.sh | BINDIR=$HOME/bin bash
Install on Archlinux via AUR:
yay -S kaf-bin
Install via Homebrew:
brew tap birdayz/kaf
brew install kaf
Show the tool version
kaf --version
Add a local Kafka with no auth
kaf config add-cluster local -b localhost:9092
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
Write message into given topic from stdin
echo test | kaf produce mqtt.messages.incoming
Set offset for consumer group dispatcher consuming from topic mqtt.messages.incoming to latest for all partitions
kaf group commit dispatcher -t mqtt.messages.incoming --offset latest --all-partitions
Set offset to oldest
kaf group commit dispatcher -t mqtt.messages.incoming --offset oldest --all-partitions
Set offset to 1001 for partition 0
kaf group commit dispatcher -t mqtt.messages.incoming --offset 1001 --partition 0
See the examples folder
Source the completion script in your shell commands file:
Bash Linux:
kaf completion bash > /etc/bash_completion.d/kaf
Bash MacOS:
kaf completion bash > /usr/local/etc/bash_completion.d/kaf
Zsh
kaf completion zsh > "${fpath[1]}/_kaf"
Fish
kaf completion fish > ~/.config/fish/completions/kaf.fish
Powershell
Invoke-Expression (@(kaf completion powershell) -replace " ''\)$"," ' ')" -join "`n")
- The streaming data platform for developers
- Single binary w/no dependencies
- Fully Kafka API compatible
- 10x lower P99 latencies, 6x faster transactions
- Zero data loss by default