I configure 10 kafka topics in my yaml file and I need create all topics on aplication start. But I do not understand how can I do it with List. I can Create one bean:
@Bean
public NewTopic newTopic() {
return new NewTopic("topic-name", 5, (short) 1);
}
But now I have list configs:
@PostConstruct
public void init(){
Map topics = this.topics.getTopics();
for (Map.Entry topicEntry : topics.entrySet()) {
TopicProperties.Topic topic = topicEntry.getValue();
String topicName = topic.getTopicName();
int partitions = topic.getNumPartitions();
short replicationFactor = topic.getReplicationFactor();
//how can I create new bean of NewTopic?
}
}
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)