Skip to content

Test branch for notification do not merge #1

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

Open
wants to merge 2 commits into
base: distribution-fix
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/kafka/consumer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ def manage_partition_consumers(handler)
distributed_partitions = self.class.distribute_partitions(running_instances, partitions)
my_partitions = distributed_partitions[@instance]

logger.info "Claiming #{my_partitions.length} out of #{partitions.length} partitions."
logger.info "Claiming #{my_partitions&.length} out of #{partitions&.length} partitions."

# based onw hat partitions we should be consuming and the partitions
# that we already are consuming, figure out what partition consumers
# to stop and start
partitions_to_stop = @partition_consumers.keys - my_partitions
partitions_to_start = my_partitions - @partition_consumers.keys
partitions_to_stop = @partition_consumers.keys - (my_partitions || [])
partitions_to_start = (my_partitions || []) - @partition_consumers.keys

# Stop the partition consumers we should no longer be running in parallel
if partitions_to_stop.length > 0
Expand Down