Node-rdkafka: Error: Invalid value "SASL_SSL" for configuration property "security.protocol"

Created on 16 Jul 2020  路  5Comments  路  Source: Blizzard/node-rdkafka

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: Fedora 31
  • Node Version [e.g. 8.2.1]: 12.16.3
  • NPM Version [e.g. 5.4.2]: 6.14.4
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: g++
  • node-rdkafka version [e.g. 2.3.3]: 2.9.0

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"

Most helpful comment

I reinstall the package and it's working, thanks all

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

klalafaryan picture klalafaryan  路  5Comments

jacob-bennett picture jacob-bennett  路  4Comments

jdowning picture jdowning  路  4Comments

corybill picture corybill  路  6Comments

mjafarpour picture mjafarpour  路  6Comments