Skip to content
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

Consumer offsets after restarting #102

Open
alifirat opened this issue Feb 2, 2018 · 2 comments
Open

Consumer offsets after restarting #102

alifirat opened this issue Feb 2, 2018 · 2 comments

Comments

@alifirat
Copy link

alifirat commented Feb 2, 2018

Hi,

I'm using your tool to make some unit test on Kafka. I wrote a test in which I want to assert that if I restart Kafka, a consumer with the same group id retrieves last committed offset. Below my test scenario :

  1. Dataset in the test is 99 elements to publish in one topic kafka and 9 elements to publish in another topic.
  2. Kafka configuration is to have 4 partitions per topic
  3. EmbeddedKafka.start()
  4. Publish DataSet
  5. Check offsets : must be 99 for one topic, 9 for another one (tests are OK)
  6. Stop Kafka : EmbeddedKafka.stop()
  7. Wait 5 seconds.
  8. Restart kafka with EmbeddedKafka.start()
  9. Check last committed for each topic : must be always 99 for one topic, 9 for another one (tests failed)

My issue start here : when stopping the EmbeddedKafka with function stop, it seems that everything is cleaned, included offsets of a group id. My question here is to know if I can produce a such scenario with Embedded Kafka or I'm missing something in the Kafka broker configuration ?

Note that I'm using the version 0.14.0.

@manub
Copy link
Owner

manub commented Feb 5, 2018

I think this could easily be addressed by adding a restart method. .stop() should clean up always, so I'd rather have a new method. Feel free to submit a PR - I have unfortunately very little time at the moment.

@arjunchhabra
Copy link

Hi @alifirat - could you share how you are checking the offsets in your test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants