Closed AhmedNSidd closed 1 month ago
👋🏻 hi and thanks for raising this question
The above code should given an error because you're not supposed to be able to create two consumer groups with the same group ID, but you're able to do so here
Why would it not be allowed? A consumer group is intended to contain more than one consumer. Whilst unusual, if you use the same groupId
for two sarama.NewConsumerGroup(...) calls within the same Go process, it is really no different functionally to you running two separate Go processes that both join the same group. You'll just have two members within your single process, with different partition assignments within the same group.
Why would it not be allowed? A consumer group is intended to contain more than one consumer. Whilst unusual, if you use the same groupId for two sarama.NewConsumerGroup(...) calls within the same Go process, it is really no different functionally to you running two separate Go processes that both join the same group. You'll just have two members within your single process, with different partition assignments within the same group.
Alright, fair enough. It just wasn't something that was clear to me from looking at the function's signature / documentation because as far as I know in Kafka, if you try to create a new consumer group with the same group ID as one that already exists, you can't generally do that. What you're referring to seems to be adding new consumers to the existing consumer group (I could be wrong, I'm still learning Kafka).
Anyway, I think we can close this issue.
Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the main branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.
Description
The issue is simple:
The above code should given an error because you're not supposed to be able to create two consumer groups with the same group ID, but you're able to do so here.
Additional context
N/A