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

Manual Consumer Offset Management #4

Closed
eapache opened this issue Aug 7, 2013 · 5 comments · Fixed by #14
Closed

Manual Consumer Offset Management #4

eapache opened this issue Aug 7, 2013 · 5 comments · Fixed by #14

Comments

@eapache
Copy link
Contributor

eapache commented Aug 7, 2013

Pending issue #2, there is no way for the consumer to manually specify which offset to start at - it's always 0. There should be a way to tell the consumer to start at a specific offset.

@burke
Copy link
Contributor

burke commented Aug 13, 2013

The two options from an API perspective seem to be:

  1. Add another parameters to NewConsumer; or
  2. Defer go c.fetchMessages(), so that there's an opportunity to manipulate the offset before the message fetcher starts.

I don't have an opinion on which is better.

@eapache
Copy link
Contributor Author

eapache commented Aug 13, 2013

The problem with whatever we do is that it's API which has to change once #2 is done, and API changes are basically verboten in go.

@eapache
Copy link
Contributor Author

eapache commented Aug 13, 2013

That said, 1) seems saner to me.

@eapache
Copy link
Contributor Author

eapache commented Aug 13, 2013

Actually, we can add a "startingOffset int64" to NewConsumer, then when #2 is done we can define FetchFromBroker as -1. That won't break compatibility.

@eapache
Copy link
Contributor Author

eapache commented Aug 13, 2013

Although idiomatically the startingOffset should be in a ConsumerOptions struct similar to the Config struct at http://godoc.org/github.com/ActiveState/tail - this lets us add more options in the future without breaking API compat, since unspecified fields in a struct are safely nil/0 by default

eapache pushed a commit that referenced this issue Aug 15, 2013
Fixes #4

When #2 lands, we can define a constant for -1 that triggers sending an
OffsetFetchRequest without touching the API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants