我正在尝试使用kafkajs
以创建卡夫卡消费者。但是,连接到 kafka 时我已经收到错误:
"[BrokerPool] Failed to connect to seed broker, trying another broker from the list: Closed connection"
这是我正在使用的代码:
const { Kafka } = require('kafkajs')
const kafka = new Kafka({
clientId: 'my-app',
brokers: [
"abc123f.xyz.cde.net:9094",
"abc123h.xyz.cde.net:9094",
"abc123k.xyz.cde.net:9094"
]
})
有谁知道为什么会发生此错误或如何解决它?