@kaluza/kt
v0.11.1
Published
A Kafka / Aiven command line tool that allow you to easily consume and produce to kafka topics with AVRO serialization and deserialization.
Downloads
28
Keywords
Readme
KT
A Kafka / Aiven command line tool that allow you to easily consume and produce to kafka topics with AVRO serialization and deserialization.
Pre-requisite
As passwords are entered in plaintest, please make sure this does not get stored in ~/.bash_history. You can use the following command to allow a space before an command will not be stored there.
echo "HISTCONTROL=ignorespace" >>~/.bashrc
Install
Require nodejs to be installed globally
npm i -g @kaluza/kt
How to use
You will need to first login to Aiven (you only need to login once per environment after install):
kt login [email protected] 1234
Login for production:
kt login [email protected] 1234 -e vnet-prd
Consume (default: vnet-dev):
kt consume TEST_OUTPUT_TOPIC
Produce (default: vnet-dev):
kt produce TEST_OUTPUT_TOPIC '{ "name": "test-name", "role": "ops" }'
Produce from a json file:
kt produce TEST_OUTPUT_TOPIC "$(cat ./test.json)"
Consume for production environment:
kt consume TEST_OUTPUT_TOPIC -e vnet-prd
Consume specific partition and offset (passing 0 and 0 will read partition 0 from the beginning):
kt consume MY_COMPACTED_TOPIC -o 0 -p 0
More informations:
kt help