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

Add Consumer.ConsumeTopic(topic, offset) #366

Closed
wvanbergen opened this issue Mar 18, 2015 · 4 comments · Fixed by #431
Closed

Add Consumer.ConsumeTopic(topic, offset) #366

wvanbergen opened this issue Mar 18, 2015 · 4 comments · Fixed by #431

Comments

@wvanbergen
Copy link
Contributor

Or another way to make the common case of consuming all partitions of a topic easier, without having to construct a Client object

@wvanbergen
Copy link
Contributor Author

As an alternative, we can expose Topics() and Partitions(topic) from Client on the Consumer, so it's not necessary to instantiate a Client anymore for this common use case.

@eapache
Copy link
Contributor

eapache commented Mar 26, 2015

I'd prefer to just implement ConsumerTopic - that covers the common case, and it's really not that much work to call NewClient and then NewConsumerFromClient.

@wvanbergen
Copy link
Contributor Author

It makes testing a lot harder, because you need to mock the entire Client.

Also for ConsumeTopic, you would have to specify a map of partition -> offset if you want to resume. It depends on your offset store if it is possible to figure out how many partitions you would need to include in a struct like that. (Kafka's FetchOffset does not, so you would have to call Partitions on the client anyway)

@eapache
Copy link
Contributor

eapache commented Mar 26, 2015

That just means we should really provide a mock client :P

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