0
votes

I'm trying to understand how does the no of partitions would affect the partition leader (broker)?

Let's say, I've a kafka cluster with 1 zookeeper, 3 brokers and 1 schema registry. My topic replication factor is 1. Now, If I've two topics A and B with 5 partitions.

Now, let's say if i send a message to topic A with key key1 and assume that based on the partitioning strategy, it is ended up being redirected to partition 5 of topic A and the leader for the partition 5 of topic A is broker 2.

In this scenario, If i send a message to topic B with key key1 (same as key as the message that was sent onto Topic A), then can we assume that it would go to partition 5 on the broker 2?

1

1 Answers

1
votes

There is no correlation between leadership and partitioning

You can guarantee that the same key will be hashed the same, and go to the same partition (assuming matching counts), but you cannot guarantee which broker will be the leader