I want to know the list of topics created in kafka server along with it's metadata.
Is there any API available to find out this?
There is API to fetch TopicMetadata, but this needs name of topic as input parameters.
I need information for all topics present in server.
Disclaimer: This e-mail may contain Privileged/Confidential information and is intended only for the individual(s) named. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. Please notify the sender, if you have received this e-mail by mistake and delete it from your system. Information in this message that does not relate to the official business of the company shall be understood as neither given nor endorsed by it. E-mail transmission cannot be guaranteed to be secure or error-free. The sender does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required please request a hard-copy version. Visit us at http://www.harbingergroup.com/
To protect yourself from changes on how Kafka uses ZooKeeper I'd do the following: - get the list of topics from ZooKeeper - get the list of Brokers from ZooKeeper - connect to the first Broker and use the list of topics to send TopicMetadataRequest requests to figure out which partitions for the topic are on which Broker (leader is what you want to know I think)
Since the leader assignments may change, be prepared for 'where' a topic/partition lives to change. For example the Broker you are talking too may suddenly be the leader for another topic/partition if that topic/partition's leader failed and the current Broker was elected leader. Depending on why you need to know about every topic/partition on a Broker may have to listen on ZooKeeper events to see that this transition happened.
Hope this helps, Chris On Wed, Mar 13, 2013 at 3:38 AM, Snehalata Nagaje < [EMAIL PROTECTED]> wrote:
If you provide an empty list in the getMetaData api, you get the metadata for all topics.
On Wed, Mar 13, 2013 at 12:38 AM, Snehalata Nagaje < [EMAIL PROTECTED]> wrote:
NEW: Monitor These Apps!
Apache Lucene, Apache Solr and all other Apache Software Foundation project and their respective logos are trademarks of the Apache Software Foundation.
Elasticsearch, Kibana, Logstash, and Beats are trademarks of Elasticsearch BV, registered in the U.S. and in other countries. This site and Sematext Group is in no way affiliated with Elasticsearch BV.
Service operated by Sematext