-
Notifications
You must be signed in to change notification settings - Fork 883
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
Use seek to manually manage offset, consumer lose some messages #1443
Comments
Hey zyi1992, With your code, I am able to reproduce this issue. I have tried multiple different settings to run your code. I didn't face issue when I use |
@pranavrth The |
Have you actually observed better performance with num_messages > 1? |
@edenhill I want to obtain msg in batches and process relevant business logic concurrently. With num_messages=1, the concurrent number will be limited by the number of partitions. |
@edenhill In our use cases we also want to batch consume up to k messages, and then time slice to do something else less important. We can mitigate by simulating this behaviour but it ends up being quite messy. |
The problem with batch consumtion is that messages may be outdated by the time you get to process them; |
Thanks, that's a fair point. Although in our use case we only have 1 consumer per consumer group so rebalancing would not affect us much. It seems the bug would still affect this scenario from the repro. |
Fixed this particular issue as part of the PR -> confluentinc/librdkafka#4117 It will be available in the upcoming release. |
The issue that you were facing is fixed in Python v2.0.2 release. There are other issues as well with batch consumer API. We have highlighted those problems in the release notes of librdkafka (Known issues column of Librdkafka v2.0.0 . We will be tackling those issues in near future. |
I have a script to test for at least one consume
the producer
the consumer
the topic
test-topic-vv
has 9 partitionfirst i run producer to add some message to topic then consume it. but i got a exception
The latest message's offset of partition 8 should be 7382 but got 7391
then i run test_for_seek to check the consumer group's actually record offset it was 7382 indeed
I also check the broker's group offset record
it also was 7382
So what happened to consumer when use seek to manage offset, hope any one can help me to deal with the problem.
check information
The text was updated successfully, but these errors were encountered: