Thanks for the explanation.

Slight digression and perhaps a silly question w.r.t. consumers.

Since multiple groups are possible, at a high level, the broker effectively
sends data of a given topic-partition to multiple consumers while keeping
track of offsets. So, why not let consumers specify the partition ID they
want to consume? Is the concept of consumer groups only because the
consumers wouldn't know in advance how many partitions exist in a topic?

Best regards.

On Wed, Jan 22, 2025 at 7:41 AM Greg Harris <greg.har...@aiven.io.invalid>
wrote:

> Hi,
>
> Thanks for the follow up.
>
> By "classic" I meant the protocol implemented by the SyncGroup/JoinGroup
> API [1]. It's a general group protocol that is still fully supported in
> Kraft, and at this time has no intention of being deprecated.
> It's called "classic" to distinguish it from the newer KIP-848 [2]
> ConsumerGroupHeartbeat API and the share group protocol used in KIP-932
> [3]. It is my understanding that these other protocols are _not_ a
> synchronizing barrier in the same way the "classic" protocol is.
>
> Hope this helps,
> Greg
>
> [1]
>
> https://github.com/apache/kafka/blob/adb033211497e539725366960e1013a4638de59f/group-coordinator/src/main/java/org/apache/kafka/coordinator/group/classic/ClassicGroup.java
> [2]
>
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-848%3A+The+Next+Generation+of+the+Consumer+Rebalance+Protocol
> [3]
>
> https://cwiki.apache.org/confluence/display/KAFKA/KIP-932%3A+Queues+for+Kafka
>
> On Tue, Jan 21, 2025 at 4:41 PM Chain Head <mrchainh...@gmail.com> wrote:
>
> > Thanks.
> >
> > By "classic" you mean pre-KRaft consensus? What is the "current" Kafka
> > Group protocol?
> >
> > Best regards.
> >
> > On Tue, Jan 21, 2025 at 9:55 PM Greg Harris <greg.har...@aiven.io.invalid
> >
> > wrote:
> >
> > > Hi,
> > >
> > > Yes you are correct. The "classic" Kafka Group Protocol is a
> > synchronizing
> > > barrier for all members.
> > > All JoinGroup member responses are returned after all JoinGroup member
> > > requests are received.
> > >
> > > Thanks,
> > > Greg
> > >
> > > On Tue, Jan 21, 2025 at 7:10 AM Chain Head <mrchainh...@gmail.com>
> > wrote:
> > >
> > > > Assume that three consumers of a certain group want to connect to a
> > > broker
> > > > for a topic with 3 partitions. After the FindCoordinator API is done,
> > the
> > > > consumers send JoinGroup. Since the broker cannot know in advance how
> > > many
> > > > consumers are expected to join, it waits
> > > group.initial.rebalance.delay.ms
> > > > before starting a rebalance.
> > > >
> > > > Therefore, does this mean the JoinGroup API response of each request
> is
> > > > "held" until the waiting period is over?
> > > >
> > > > Best regards.
> > > >
> > >
> >
>

Reply via email to