How can I get number of partitions for any kafka topic from the code. I have researched many links but none seem to work.
Mentioning a few:
http://grokbase.c
@Sunil-patil answer stopped short of answering the count piece of it. You have to get the size of the List
producer.partitionsFor("test").size()
@vish4071 no point butting Sunil, you did not mention that you are using ConsumerConnector in the question.