Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with consumer group example #3023

Open
zzhangsg opened this issue Dec 3, 2024 · 2 comments
Open

Issue with consumer group example #3023

zzhangsg opened this issue Dec 3, 2024 · 2 comments
Labels
stale Issues and pull requests without any recent activity

Comments

@zzhangsg
Copy link

zzhangsg commented Dec 3, 2024

Description

Context
From the example provided in this repository, a single consumer is created within the consumer group to process messages, and it gets assigned to all partitions of a Kafka topic. However, Kafka's design encourages leveraging partitioning to enable parallelism, which seems to favor multiple consumers within the same group for optimal resource utilization.

To align with Kafka's design and achieve partition-level parallelism, we are exploring a setup where N consumers are initialized within the same consumer group. This involves creating N clients and passing them to the NewConsumerGroupFromClient function with the same consumer group ID so that each consumer gets one partition.

Questions

  1. Is this model valid?
  • Can we create multiple consumers within the same group by initializing multiple clients and assigning them to the same consumer group ID?
  1. Rebalancing and Partition Assignment:
  • How does the partition rebalancing handling work when using this model?
  • If the number of partitions increases or decreases, how are the changes reflected across the multiple consumers within the group?
Versions
Sarama Kafka Go
Configuration
Logs
logs: CLICK ME


Additional Context
@zzhangsg
Copy link
Author

zzhangsg commented Dec 3, 2024

Hi @dnwe / @puellanivis, been browsing the past issues and saw that you are active contributors to this repo, could you please help share some insights when you get a chance? TIA!

Copy link

github-actions bot commented Mar 3, 2025

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.

@github-actions github-actions bot added the stale Issues and pull requests without any recent activity label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues and pull requests without any recent activity
Projects
None yet
Development

No branches or pull requests

1 participant