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
Calling consumer.Assign is not actually optional #163
Comments
Your analysis is spot on, and the documentation is wrong - when using the channel-based consumer with rebalance events the application must call Assign() to sync state. There is a comment in the code that says exactly this, too bad it wasn't in the docs: |
@edenhill We are using a Poll-based consumer and would like to have the option of choosing offsets when we get an AssignedPartitions event. |
@edenhill Sorry to hijack this issue but I didn't want to open a new one. We have the following scenario: we're using the poll-based consumer and we have My question, is that the suggested use-case? Asking because we noticed that sometimes a consumer might not receive any messages even though it's subscribed to a partition that does have messages. |
That should indeed work. One reason you are not seeing messages might be that there are no new messages coming in, and the consumer defaults to fetching only new messages ( If this is not the case you can debug the consumer by setting the |
There were actually new messages produced to the partition, the consumer was indeed subscribed to the partition (as reported by It's as if we weren't calling In any way, I'll add |
Just wanted to add that we're on librdkafka 0.11.1. |
@edenhill From here |
Description
Seeing this in channel consumer.
The documentation states (emphasis mine):
It doesn't look like it automatically calls
Assign()
. I'm seeing no consumption if that call is removed (at least not in the channel consumer).How to reproduce
go.application.rebalance.enable
set totrue
.kafka.AssignedPartitions
but don't call.Assign()
on themChecklist
Please provide the following information:
LibraryVersion()
):confluent-kafka-go:
v0.11.0
0.11.0
Client configuration:
ConfigMap{...}
go.application.rebalance.enable
:true
go.events.channel.enable
:true
The text was updated successfully, but these errors were encountered: