Environment Information
Steps to Reproduce
node kafka.js
node-rdkafka Configuration Settings
const kafka = require('node-rdkafka')
const USERNAME = <USERNAME>
const PASSWORD = <PASSWORD>
const kafkaConf = {
"group.id": "cloudkarafka-example",
"metadata.broker.list": <BROKER_LIST>,
"socket.keepalive.enable": true,
"security.protocol": "SASL_SSL",
"sasl.mechanisms": "SCRAM-SHA-256",
"sasl.username": USERNAME,
"sasl.password": PASSWORD,
"debug": "generic,broker,security"
};
const consumer = new kafka.KafkaConsumer(kafkaConf);
consumer.on("ready", arg => {
console.log(`Consumer ${arg.name} ready`);
consumer.subscribe(<SOME_TOPIC>);
consumer.consume();
});
consumer.on('error', err => {
console.log("Consumer Error: " + err);
});
Additional context
this._client = new SubClientType(globalConf, topicConf);
^
Error: Invalid value "SASL_SSL" for configuration property "security.protocol"
Have you tried "sasl_ssl" - as lowercase?
From my IDE's bring up config.d.ts:
/**
* Protocol used to communicate with brokers.
*
* @default plaintext
*/
"security.protocol"?: 'plaintext' | 'ssl' | 'sasl_plaintext' | 'sasl_ssl';
@alterationx10, Yes, still doesn't work
May be you have to try this configuration.
https://github.com/Blizzard/node-rdkafka#mac-os-high-sierra--mojave
make sure you have openssl installed then set CPPFLAGS and LDFLAGS
example:
CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib npm install [email protected]
I reinstall the package and it's working, thanks all
Most helpful comment
I reinstall the package and it's working, thanks all