From 7d9446d8bcfe3427958ef4213f07643a90f4a826 Mon Sep 17 00:00:00 2001 From: Nasar Khan Date: Thu, 2 May 2024 16:20:07 -0400 Subject: [PATCH] retrieve kafka metadata method --- lib/manageiq/messaging/kafka/client.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/manageiq/messaging/kafka/client.rb b/lib/manageiq/messaging/kafka/client.rb index 77eccb5..2fcf948 100644 --- a/lib/manageiq/messaging/kafka/client.rb +++ b/lib/manageiq/messaging/kafka/client.rb @@ -69,6 +69,11 @@ def topics Rdkafka::Metadata.new(native_kafka).topics.collect { |topic| topic[:topic_name] } end + def metadata + native_kafka = producer.instance_variable_get(:@native_kafka) + Rdkafka::Admin.new(native_kafka).metadata + end + private attr_reader :kafka_client