Skip to content

Commit 8660d05

Browse files
authored
Merge pull request #817 from abicky/disconnect-after-leaving
Disconnect after leaving the group
2 parents d6c7c9c + 0f6caf9 commit 8660d05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/kafka/consumer.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ def subscribe(topic_or_regex, default_offset: nil, start_from_beginning: true, m
125125
def stop
126126
@running = false
127127
@fetcher.stop
128-
@cluster.disconnect
129128
end
130129

131130
# Pause processing of a specific topic partition.
@@ -443,6 +442,7 @@ def consumer_loop
443442
# important that members explicitly tell Kafka when they're leaving.
444443
make_final_offsets_commit!
445444
@group.leave rescue nil
445+
@cluster.disconnect
446446
@running = false
447447
@logger.pop_tags
448448
end

0 commit comments

Comments
 (0)