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

Handle consumer groups with new client #359

Merged
merged 7 commits into from
Sep 2, 2019
Merged

Conversation

dantswain
Copy link
Collaborator

This ended up being surprisingly easy. Where I got hung up before is
that the new client doesn't know about any topics by default (fetching
all topics for a large cluster can cause timeouts), but it needs to know
about the topics that belong to the consumer group. So I added an
initial_topics setting for the new client's initialization and pass
that in from the consumer group set up. The old client will just ignore
this setting.

This ended up being surprisingly easy.  Where I got hung up before is
that the new client doesn't know about any topics by default (fetching
all topics for a large cluster can cause timeouts), but it needs to know
about the topics that belong to the consumer group.  So I added an
`initial_topics` setting for the new client's initialization and pass
that in from the consumer group set up.  The old client will just ignore
this setting.
@@ -698,7 +703,7 @@ defmodule KafkaEx.GenConsumer do
end

case response do
%{last_offset: nil, message_set: []} ->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we were matching on this before. The new client passes the actual last offset even if the message set is empty.

Copy link
Member

@joshuawscott joshuawscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM

@dantswain dantswain merged commit b069b39 into master Sep 2, 2019
@dantswain dantswain deleted the new_client_consumer_group branch September 2, 2019 00:23
@joshuawscott joshuawscott mentioned this pull request Jul 14, 2020
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

Successfully merging this pull request may close these issues.

2 participants