- This script uses kafkacat, Please install them for your platform from here
- This script also assumes the machine on which you are executing it has connection to the Kafka cluster
This script is used to count number of messages in a Kafka topic
Prepare input file, Input file should be of the format <TOPIC_NAME>,<INCLUDE_FLAG>
- TOPIC_NAME - Topic name
- INCLUDE_FLAG - Flag(Yes/No) to count OR exclude a topic
Execute the script by running the command ./get-payload-size.sh localhost:9094 /input/demo.txt
localhost:9094
is the BOOTSTRAP_SERVERS/input/topic-list/demo.txt
is the path for the input file which was prepared in step 01.
Make sure the script has execute permission by running
chmod 0774 get-payload-size.sh
Script execution will generate html and csv report in reports
sub directory. Here is how an report would look like.