Hi all, I have a (relatively) simple streams topology that is producing
some counts, and while testing this code I'm seeing some occasional
incorrect aggregation results. This seems to happen when a re-balance
occurs - typically due to a timeout or communication hiccup with the Kafka
broker. The
You can use the KafkaConsumer#assignment() method to get all the assigned
topic-partitions for that consumer instance.
But, you've to periodically call poll method to get the latest assignment
which may return records.
This shortcoming is actively discussed in the below threads.
https://mail-archi
Kafka doesn’t have regex subscription. You could get a list of available
topic using admin client. From there, you can decide what topics you would
like to subscribe to (or process using your logic).
Check documentation for AdminClient.listTopics and ListTopicResult holder.
I hope this helps.
Re
Hi,
I have initialised kafka consumer:
KafkaConsumer consumer = new KafkaConsumer(consumerConfig);
and subscribed with topic pattern:
consumer.subscribe(Pattern.compile(topicRegex), listener);
now, I'm trying to get the list of topics.
Map> topicsPartitions = consumer.listTopics();
here topic li