2

I have a Kafka consumer service (spring boot). The problem is the topic names are not statically available i.e., not in properties file. The Consumer service has to request for the topic names from other service. I am not sure how to use @KafkaListener(topic="") annotation in this requirement. Appreciate any help.

I have verified this How to create separate Kafka listener for each topic dynamically in springboot? As it is 6 years old thread, just want to check is there anything new approach available using spring kafka listener?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Rasool
  • 43
  • 1
  • 4
  • What's stopping you from querying your service and creating many ContainerProperties instances, per name, as the linked post shows? – OneCricketeer Jan 03 '23 at 14:56

1 Answers1

-1

Kafka stores list of topics inside (old) ZooKeeper or (new) KRaft.

Example for ZooKeeper https://stackoverflow.com/a/29880334/149818

Sorry, I have no experience with KRaft API yet, but taking in account that command line tool works the same way reference approach is the same.

Dewfy
  • 23,277
  • 13
  • 73
  • 121