2
votes

I have a kafka topic with 4 partitions as I have a consumer group with 4 consumers.

My intent is to ensure that messages are equally distributed across partitions.

Is there a way to verify the message distribution across partitions of a kafka topic ?

1

1 Answers

5
votes

I am assuming you are using Kafka new producer. Then you could specify no key for each message, which means Kafka employs a round-robin manner to evenly distribute messages to all partitions.

You could invoke command below to check the distribution across all partitions:

bin/kafka-run-class.sh kafka.tools.GetOffsetShell --broker-list broker1:9092 --topic <topic> --time -1