Closed helio-frota closed 2 years ago
it seems to be something with the admin code because I was able to create the topic using the broker code. example:
Working
const cluster = createCluster()
await cluster.refreshMetadata()
const broker = await cluster.findControllerBroker()
try {
const result = await broker.createTopics({
waitForLeaders: false,
topics: [{ topic: topicName, numPartitions: 1, replicationFactor: 3 }],
})
} catch (error) {
console.error(error)
}
This is not working for me:
admin = createAdmin({ cluster: createCluster(), logger: newLogger() })
await admin.connect()
try {
const result = await admin.createTopics({
waitForLeaders: false,
topics: [{ topic: topicName, numPartitions: 1, replicationFactor: 3 }],
})
} catch (error) {
console.error(error)
}
But the fact is that I'm using KafkaJS integration tests against other Kafka and makes no sense for me to change this integration test upstream.
There is a significant difference related to topic creation between broker and admin code?
I found the issue. I need to change the ssl connection options to ssl: true,
instead of the existing configuration on the testHelpers. https://github.com/tulios/kafkajs/blob/master/testHelpers/index.js#L46
This is causing the not_controller issue I described above in previous comments.
I'm trying to run the tests in a different environment and when running the tests I'm receiving this error when trying to create a topic do you have any fix/workaround or any tip on how to solve it?
This particular error is happening on this test https://github.com/tulios/kafkajs/blob/master/src/admin/__tests__/createTopics.spec.js#L57
thanks