GithubHelp home page GithubHelp logo

Comments (10)

v0idpwn avatar v0idpwn commented on July 22, 2024 6

I'll open one in a few minutes, I have fixed it locally :)

from broadway_kafka.

msaraiva avatar msaraiva commented on July 22, 2024 2

Hi @victorolinasc!

I'll release a new version today.

Thanks for your contribution!

from broadway_kafka.

josevalim avatar josevalim commented on July 22, 2024

Correct. Earliest is used only for the cases where you want to frequently start from the beginning. Latest is the one with the behavior you want. It is the latest committed.

from broadway_kafka.

gerbal avatar gerbal commented on July 22, 2024

Then offset_reset_policy: :earliest has two effects

  • start unknown kafka consumers at earliest offset
  • reset all consumers to earliest offset any time brod receives any changes to partition assignments

While in offset_reset_policy: :latest only has one

  • start unknown kafka consumers at latest offset

What should I do if I want new consumers to start at the earliest offset but not reset to the earliest offset on app restart?

from broadway_kafka.

josevalim avatar josevalim commented on July 22, 2024

If you don't have a committed offset, then that's how latest behaves. If you have a committed offset, then it is not possible with the current options, but I believe Kafka has APIs that allow you to reset it manually.

from broadway_kafka.

v0idpwn avatar v0idpwn commented on July 22, 2024

@josevalim I believe this is not the way :earliest is expected to behave. Offset reset policies should be used only when the offset is undefined or when the kafka current_offset is expired.

We can see this in Confluent docs: https://docs.confluent.io/current/clients/consumer.html#offset-management and I'd say even broadway_kafka documentation for offset_reset_policy implies this:

Defines the offset to be used when there's no initial offset in Kafka or if the current offset has expired. Possible values are :earliest or :latest. Default is :latest.

from broadway_kafka.

josevalim avatar josevalim commented on July 22, 2024

You are correct. I misunderstood the docs. Thanks for the reference.

from broadway_kafka.

josevalim avatar josevalim commented on July 22, 2024

In case someone wants to send a PR, it will be very appreciated too. :)

from broadway_kafka.

victorolinasc avatar victorolinasc commented on July 22, 2024

Hey @josevalim ! Thanks for taking this in!

Can you release a minor version on hex? This would be greatly appreciated.

Thanks once again!

from broadway_kafka.

msaraiva avatar msaraiva commented on July 22, 2024

@v0idpwn thanks for the PR! ❤️

from broadway_kafka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.