Skip to content

Commit

Permalink
Merge pull request #403 from mjparrott/fix-consumer-group-attempt-number
Browse files Browse the repository at this point in the history
Increment attempt number instead of decrement when joining a consumer group
  • Loading branch information
jbruggem authored Apr 26, 2020
2 parents aaa0aa4 + 4444c96 commit 1113a82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/kafka_ex/consumer_group/manager.ex
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ defmodule KafkaEx.ConsumerGroup.Manager do
on_successful_join(state, join_response)

{:error, :no_broker} ->
if attempt_number == @max_join_retries do
if attempt_number >= @max_join_retries do
raise "Unable to join consumer group #{state.group_name} after " <>
"#{@max_join_retries} attempts"
end
Expand All @@ -292,7 +292,7 @@ defmodule KafkaEx.ConsumerGroup.Manager do
)

:timer.sleep(1000)
join(state, attempt_number - 1)
join(state, attempt_number + 1)

%{error_code: error_code} ->
raise "Error joining consumer group #{group_name}: " <>
Expand Down

0 comments on commit 1113a82

Please sign in to comment.