Have you looked at partitionsFor()?

-Jason

On Wed, Mar 16, 2016 at 4:58 AM, Kamal C <[email protected]> wrote:

> Hi,
>
>     I'm using the new consumer in assign mode. I would like to assign all
> the partitions of a topic to the consumer.
>
> For that, I need to know the number of partitions available in the topic.
>
> *consumer.assign(List<TopicPartitions> partitions);*
>
> How to programmatically get the number of partitions in a topic?
>
> --Kamal
>

Reply via email to