Skip to content

Question Regarding ConsumerGroup's Consume() method #2629

Answered by d1egoaz
zzhangsg asked this question in Q&A
Discussion options

You must be logged in to vote

Usually the errors returned by .Consume are not recoverable, newSession will try the best effort, up to c.config.Consumer.Group.Rebalance.Retry.Max attempts to get a valid consumer group, assuming the preconditions are correct (brokers reachables, timeout configured correctly, topics exists, ssl certificates are valid and aren't expired, etc)

https://github.com/Shopify/sarama/blob/65f0fec86aabe011db77ad641d31fddf14f3ca41/consumer_group.go#L205

In my experience, I've seen that most cases devs just return the error to close the consumer loop, and try to recreate NewConsumerGroup, which basically tries to recreate the client connection, you could potentially have a circuit breaker, or some m…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by dnwe

This comment has been hidden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
stale Issues and pull requests without any recent activity
2 participants
Converted from issue

This discussion was converted from issue #1910 on August 29, 2023 15:53.