Differentiating between non-existent and un-authorized topic in librdkafka

醉酒当歌 提交于 2021-02-05 11:14:14

问题


How can I make sure if a topic is authorized or not ?

I need this because, in my consumer I get the meta data for all the known topics and then do assign call. The metadata call doesn't give the un-authorized topics and non-existent topic. If a topic doesn't exist, I'll create one and if a topic is unauthorized, I have to fail. But I don't have a way to differentiate between non-existent and unauthorized topic.


回答1:


You can try listing all the topics, if the topic exists it will be there in the list. I did not use librdkafka but still from the link, the author says the following function should give you (without the topic argument).

rd_kafka_metadata()


来源:https://stackoverflow.com/questions/62187382/differentiating-between-non-existent-and-un-authorized-topic-in-librdkafka

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!