Getting topic from metadata #3600
Unanswered
ThalesCarl
asked this question in
Q&A
Replies: 1 comment 1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone.
I am new user of librdkafka and kafka in general, therefore if this is a dumb question, let me know. That said, I need a way to get a topic from the metadata.
Suppose I have a broker running with some topics on it and I want to create a new topic. But first, I need to check if the broker already has this topic. I have successfully listed all the topics in my broker using the
rd_kafka_metada
function and I was able to verify whether the broker has or not the topic I want to create. In this situation, if the topic already has the topic, I want a way to assign this topic to ard_kafka_topic_t
variable.Here is a MWE of how my code is structured so far (suppose I have already created a
producer_
and atopic_conf_
variable, which are member of my class) :Thanks in advance.
PS: I am using Kafka version 2.7 and librdkafka version 1.5.2 running on a centos7
Beta Was this translation helpful? Give feedback.
All reactions