-
Notifications
You must be signed in to change notification settings - Fork 118
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
Lazy consumer group creation causes systematic loss of produced records before the first polling operation #464
Comments
This was already discussed in the past more or less. |
Thanks for the comment @ppatierno.
I guess we can close this one then or you think it can be useful for tracking purposes ? |
@codeJack I have one more question ...
You are right here but at this point, I missed your use case. The "auto.offset.reset" policy is applied only when there is no committed offset for the consumer group where the consumer is joining. Of course, if you join the group with a poll before producing (as you mentioned), you are actually not using any kind of reset policy but just "waiting" for messages and consuming them as they came. |
@codeJack going to close this one because not hearing from you since years. If anything should be still discussed feel free to re-open this. |
Context
This might be working as designed but I guess worth discussing.
I'm using strimzi-kafka-bidge for integration testing purposes; more precisely I have a simple event-driven microservice - kafka streams based - with a basic source-processor-sink topology running in a cluster, and I want to test that producing a given input record against the source results into a certain output record produced against the sink.
Versions (to be tested against a more recent version)
Steps to reproduce
Code snippets in python are not exhaustive but purely informative to clearly highlight the consumed bridge APIs.
consumer_name
is a randomly generated namesink-topic
source-topic
.Sleep a certain amount of time to ensure that the output record has been created by the service.
No matter how much you sleep here the issue persists
Consume records to assert the output record is what we expected
Response is empty
Please note that I have been trying to produce and consume against the very same topic to completely isolate the issue from any dependency it might have with my own service and it is still reproducible (sink-topic == source-topic).
Workaround
BEGIN workaround steps
auto.offset.reset
islatest
and nothing has been produced yet simply to fully initialize the consumer (takes approximatively 3s probably due to the lazy initialization)END workaround steps
Conclusion / Proposal
It might be of common interest to expose a synchronous flavor of the API - for what concerns consumer group subscription - to smoothly cover scenarios like the one described here.
The text was updated successfully, but these errors were encountered: