Skip to content

Commit

Permalink
close kafka admin client connection
Browse files Browse the repository at this point in the history
  • Loading branch information
nasark committed May 3, 2024
1 parent 0fd700a commit 3619ba3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/manageiq/messaging/kafka/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def ack(ack_ref)
end

def close
@admin&.close
@admin = nil

@producer&.close
@producer = nil

Expand Down
4 changes: 4 additions & 0 deletions lib/manageiq/messaging/kafka/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ module Common

private

def admin
@admin ||= kafka_client.admin
end

def producer
@producer ||= kafka_client.producer
end
Expand Down

0 comments on commit 3619ba3

Please sign in to comment.