I am trying to connect to a 3rd party broker using ssl.
I got 4 files from the external team
- server.pem
- ca-certificate.pem
- server-private.key
- server-private.pem
I am trying to connect using FQDN but getting error Error : Caused by: KafkaJSError: This is not the correct coordinator for this group
. What could be the issue? Am I using the certificates in the wrong way?
Below is the kafka config which I am using.
const ca = fs.readFileSync(path.join(__dirname, 'path/to/ca-certificate.pem'), 'utf-8');
const cert = fs.readFileSync(path.join(__dirname, 'path/to/server.pem'), 'utf-8');
const keyPem = fs.readFileSync(path.join(__dirname, 'path/to/server-private.pem'), 'utf-8');
const key = fs.readFileSync(path.join(__dirname, 'path/to/server-private.key'), 'utf-8');
const kafkaConfig = {
clientId: "test-client-id",
brokers: ["fqdn-example1.com:9093", "jfqdn-example2.com:9093", "jfqdn-example3.com:9093"],
ssl: {
rejectUnauthorized: true,
ca: [ca],
cert: cert,
key: key + 'n' + keyPem,
},
connectionTimeout: 10000,
authenticationTimeout: 10000,
logLevel: logLevel.DEBUG
};