You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Dominique De Vito <dd...@gmail.com> on 2017/08/23 09:22:24 UTC

about Kafka behavior with distinct groups of consumers, but with the same group.id ?

Hi,

I am wondering about Kafka behavior.

So, let me explain the use case I face.

I have 2 different groups of consumers:

* group of consumers G1 to consume only msgs from topic T1
* group of consumers G2 to consume only msgs from topic T2

The question is... What happens if I set the same group.id for both groups?

On one side, I say to Kafka: nodes in G1 and G2 are completely separated,
as they read distinct topics.

On the other side, I say to Kafka: nodes in G1 and G2 are somewhat similar,
as they have the same group.id.

* Is this use case authorized ?
* if so, is Kafka behavior well defined for such a use case ? and what is
the use case ?
* even if authorized, I guess it's not the best pratice (to have distinct
group of consumers with different topics but the same group.id), isn't it ?

Many thanks.

Regards,
Dominique

Re: about Kafka behavior with distinct groups of consumers, but with the same group.id ?

Posted by Manikumar <ma...@gmail.com>.
Consumers with the same group.id are part of the same consumer group.
Topic/partitions are load-balanced over the consumer instances based on
their topic subscriptions.
In this case G1, G2 consumers are part of the same group, T1 is balanced
over G1 and T2 over G2.
This is a valid scenario.

On Wed, Aug 23, 2017 at 2:52 PM, Dominique De Vito <dd...@gmail.com>
wrote:

> Hi,
>
> I am wondering about Kafka behavior.
>
> So, let me explain the use case I face.
>
> I have 2 different groups of consumers:
>
> * group of consumers G1 to consume only msgs from topic T1
> * group of consumers G2 to consume only msgs from topic T2
>
> The question is... What happens if I set the same group.id for both
> groups?
>
> On one side, I say to Kafka: nodes in G1 and G2 are completely separated,
> as they read distinct topics.
>
> On the other side, I say to Kafka: nodes in G1 and G2 are somewhat similar,
> as they have the same group.id.
>
> * Is this use case authorized ?
> * if so, is Kafka behavior well defined for such a use case ? and what is
> the use case ?
> * even if authorized, I guess it's not the best pratice (to have distinct
> group of consumers with different topics but the same group.id), isn't it
> ?
>
> Many thanks.
>
> Regards,
> Dominique
>