-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
why example consumergroup can not work correctly ? only one client can consume message, other client can not work #1516
Comments
Hey @meiyang1990 what is your topic configuration? how many partitions does the topic have? |
i can confirm this is also happening. TL;DR :: sarama "rebalancing" is not working correctly (if it ever did) specs:: kafka 2.2
5a. kafka goes into re-balence mode
then moments later still only ONE consumer is consuming (in this case the new one) 5b. Consumer 2 claims "everything"
5b. the watcher on the kafka node itself confirming that the new one claimed everything
|
Same issue. @d1egoaz @meiyang1990 |
Same with me. |
The above is a symptom of not looping on Under the hood it seems like when a re-balance occurs all sessions are torn down completely (briefly no members exist and therefore no partitions are handled by anyone) and when you re-call |
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. |
some weeks ago we added some comments to what @pavius commented above. @meiyang1990 @wyndhblb @vikrampunchh @meiyang1990 @gauravds |
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. |
@d1egoaz I am still getting this issue. I am starting 3 consumers, all in the same consumer group. The call to Before publishing any messages I can see that all 3 consumers have called I have the consumer group rebalance strategy set to round robin. Any ideas what's going on here? |
I wonder if you can paste some code about how's your consumer subscription/consume workflow. |
@d1egoaz I've created an example here: https://github.com/TomWright/sarama-example There are some basic instructions in the readme. It uses this repo to run the consumer: https://github.com/TomWright/gracesarama/blob/main/consumer.go#L48 |
thanks! I'm looking at this specifically:
edit: if this is how your test is configured, that's the reason the message is only going to one member. A claim (topic/partition) can only be read by a single member of a group, a member can consume multiple different partitions/topics, in your case, even if you have N members, only 1 (1 partitition) will consume messages. Partitions define the concurrency of the topic, if you want to partition/consume faster with more members, you should increase the partitions. Try adding more partitions to your topic first. |
after I manually deleted/created the topic with more partitions I can see more members consuming the messages
BTW, I don't think the confluent image supports |
Ah I see. That makes sense. Thank for your feedback on this! Now you mention that it's obvious 🤦♂️ |
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. |
Reading back through this issue it looks like all problems were resolved |
Versions
Please specify real version numbers or git SHAs, not just "Latest" since that changes fairly regularly.
Configuration
What configuration values are you using for Sarama and Kafka?
Logs
When filing an issue please provide logs from Sarama and Kafka if at all
possible. You can set
sarama.Logger
to alog.Logger
to capture Sarama debugoutput.
logs: CLICK ME
Problem Description
The text was updated successfully, but these errors were encountered: