wbarnha / kafka-python-ng

Fork for Python client for Apache Kafka
https://wbarnha.github.io/kafka-python-ng/
Apache License 2.0
67 stars 8 forks source link

Console commands #167

Open wbarnha opened 6 months ago

wbarnha commented 6 months ago

This adds ConsoleProducer/Consumer classes and 3 simple scripts for producing, consuming, and creating topics. This can be useful for testing and checking the state of things in kafka.

These commands are minimal right now, but more options/features can be added in the future.

How to use:

$ kp_create_topic -b 127.0.0.1:9092 -t "hello"
$ kp_producer -b 127.0.0.1:9092 -t "hello"
yo dude
what's up?

# Meanwhile, in another terminal...
$ kp_consumer -b 127.0.0.1:9092 -t "hello" -g "analytics"
yo dude
what's up?

This change is Reviewable