A Kafka / Aiven command line tool that allow you to easily consume and produce to kafka topics with AVRO serialization and deserialization.
npm install @kaluza/ktA Kafka / Aiven command line tool that allow you to easily consume and produce to kafka topics with AVRO serialization and deserialization.
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
Require nodejs to be installed globally
```
npm i -g @kaluza/kt
You will need to first login to Aiven (you only need to login once per environment after install):
``
kt login user@kaluza.com 1234
Login for production:
``
kt login user@kaluza.com 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