You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by "Saurabh Agarwal (BLOOMBERG/ 731 LEX -)" <sa...@bloomberg.net> on 2014/05/21 00:41:51 UTC

Java API to list topics and partitions

Hi,

Is there java API in kafka to list topics and partitions in the kafka broker?   
Thanks, 
Saurabh.

Re: Java API to list topics and partitions

Posted by Jun Rao <ju...@gmail.com>.
You can issue a TopicMetadataRequest. See
https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example

Thanks,

Jun


On Tue, May 20, 2014 at 3:41 PM, Saurabh Agarwal (BLOOMBERG/ 731 LEX -) <
sagarwal144@bloomberg.net> wrote:

> Hi,
>
> Is there java API in kafka to list topics and partitions in the kafka
> broker?
> Thanks,
> Saurabh.

Re: Java API to list topics and partitions

Posted by Timothy Chen <tn...@gmail.com>.
There is a Scala API. You can take a look at TopicCommand.scala as
kafka-topics.sh simply calls that class.

Tim

On Tue, May 20, 2014 at 3:41 PM, Saurabh Agarwal (BLOOMBERG/ 731 LEX
-) <sa...@bloomberg.net> wrote:
> Hi,
>
> Is there java API in kafka to list topics and partitions in the kafka broker?
> Thanks,
> Saurabh.