Hi,
I have initialised kafka consumer:
KafkaConsumer<byte[], byte[]> consumer = new KafkaConsumer<byte[],
byte[]>(consumerConfig);

and subscribed with topic pattern:
consumer.subscribe(Pattern.compile(topicRegex), listener);

now, I'm trying to get the list of topics.
Map<String, List<PartitionInfo>> topicsPartitions = consumer.listTopics();

here topic list is not following given pattern. it is giving all topic list.
Is this expected behaviour? Is there any API to get subscribed topic list
with consumer instance?
or Do I need to write simple prog to process this list with same pattern?

Reply via email to