Fixed Kafka bug with consumer groups and timeouts during repartitioning #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
In IBM/sarama#1192, a user reported seeing
read tcp <ip>:63133-><ip>:9092: i/o timeout
errors when consuming Kafka messages with a consumer group during rebalancing. As a response, Sarama updated their documentation and examples to indicate that theConsumeClaim
function should explicitly check for a completedContext
(see: IBM/sarama#2240). It's possible that we may have run into the same problem when usingnats-kafka
, as we recently saw very similar errors in a production installation.Description
With this PR, we're updating nats-kafka's Kafka Consumer to align with the updated usage advice from the Sarama developers (https://github.com/Shopify/sarama/blob/main/examples/consumergroup/main.go).