You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Krzysztof Ociepa <oc...@gmail.com> on 2014/04/09 13:49:25 UTC

The easiest way to fetch the topic metadata in my java app

Hi Team,

I would like to ask you about the easiest way to fetch topics metadata
from my app. My goal is monitoring of the topic size in my java app
(when I have also producers). Is there any API in Kafka libs for that? I
would like to avoid direct connection to the Zookeeper.

Thanks,
Chris

Re: The easiest way to fetch the topic metadata in my java app

Posted by Jun Rao <ju...@gmail.com>.
When you say "topic size", do you mean # of topics? If so, you can send
TopicMetadataRequest to any broker. See
https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Examplefor
details. In particular, if the topic list in the request is empty, you
get all topics.

Thanks,

Jun


On Wed, Apr 9, 2014 at 4:49 AM, Krzysztof Ociepa <ociepa.krzysztof@gmail.com
> wrote:

> Hi Team,
>
> I would like to ask you about the easiest way to fetch topics metadata
> from my app. My goal is monitoring of the topic size in my java app
> (when I have also producers). Is there any API in Kafka libs for that? I
> would like to avoid direct connection to the Zookeeper.
>
> Thanks,
> Chris
>