I'm reading Kafka documentation about consumers and faced the following message consumption definition:
Our topic is divided into a set of totally ordered partitions, each of which is consumed by exactly one consumer within each subscribing consumer group at any given time. This means that the position of a consumer in each partition is just a single integer, the offset of the next message to consume.
I interpreted the wording as follows:
A consumer group reads data from a topic consisting of a number of partitions. Then each consumer from the group is assigned with some subset of partitions that do not overlap with other consumer's partitions from the group.
Consider the following case:
A consumer group GRP
consisting of 2 consumers C1
and C2
reads data from a topic TPC
consisting of 2 partitions P1
and P2
.
QUESTION: If at some point C1
reads from P1
and C2
reads from P2
can it be rebalanced so that C1
starts reading from P2
and C2
from P1
. If so under which condition may that happen?
It does not contradict to the quote above.