Symptoms

The messages that are sent to a topic are unevenly distributed among the partitions of the topic. Some partitions have more messages, some partitions have fewer messages, and some partitions even have no messages.

You can check the number of messages in each partition on the Partition Status tab of the Topic Details page. The number of offsets indicates the number of messages. As shown in the following figure, Partition 2 has more messages than each of the other partitions. Some partitions even have no messages. Uneven distribution of messages among partitions

Causes

  • Messages are sent only to the specified partitions. As a result, the unspecified partitions have no messages.
  • Messages are sent to a specified partition based on a specified message key. As a result, messages are unevenly distributed among partitions.
  • The partition assignment policy is re-coded, but the policy logic has defects. As a result, messages are unevenly distributed among partitions.