Create topics sync in KafkaClient
ellik95 opened this issue · 2 comments
Hi,
I use the following code in order to create a topic with certain configs.
createTopics(topics) {
return new Promise((resolve, reject) => {
this.client.createTopics(topics, (err, result) => {
if (err) return reject(err);
console.log('create topics result ', result);
return resolve(result);
});
})
}
I saw that producer has createTopics function as well and can be called with async=true in order to ensure that the method will not return until all topics are created, but does not take as argument the configs of the topic.
Is there something similar that I can use in order to create a topic with certain configs and wait for the topic to be created?
Thank you!
After further testing I found that the topic is created fine with it's configs, but the problem is that the first message produced to that topic is missed.
I added kafka option fromOffset: 'earliest'
while initializing kafkaClient, and now the first message is consumed! So I will close the issue now.