Skip to content

Facing issues with client connection #29

@SaiManikantaG

Description

@SaiManikantaG

Environment Information

  • OS [e.g. Mac, Arch, Windows 10]: MacOS Sonama 14.3.1
  • Node Version [e.g. 8.2.1]: Node.js v20.11.0
  • NPM Version [e.g. 5.4.2]: 10.2.4
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]: gcc --version
    Apple clang version 15.0.0 (clang-1500.1.0.2.5)
    Target: arm64-apple-darwin23.3.0
    Thread model: posix
    InstalledDir: /Library/Developer/CommandLineTools/usr/bin
  • confluent-kafka-javascript version [e.g. 2.3.3]: "^0.1.10-devel"

Steps to Reproduce
Installed the package using npm: npm install @confluentinc/kafka-javascript
Used original example provided as shown in the welcome page for producing the message

confluent-kafka-javascript Configuration Settings

const  { Kafka } = require('@confluentinc/kafka-javascript').KafkaJS
const kafka = new Client({
    KafkaJS: {
      brokers: ["xxxxxxxxxx"],
      ssl: true,
      sasl: {
        mechanism: "plain",
        username: "xxxxxxx",
        password:
          "yyyyyyyyyyyyy",
      },
    },
  });

Team informed me about the early access version and I am trying to see how the package works and was not able to start the client at all and gives me following errors.

const kafka = new Client({
                ^

ReferenceError: Client is not defined
    at producerStart (/Users/sai/Documents/Development/messaging/confluent.js:9:17)
    at Object.<anonymous> (/Users/sai/Documents/Development/messaging/confluent.js:47:1)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
    at node:internal/main/run_main_module:28:49

I did do some extra checks to see if everything package is working as expected or not and was able to see the features and librdversion

const details = require("@confluentinc/kafka-javascript").features;

Result:

[
  'gzip',             'snappy',
  'ssl',              'sasl',
  'regex',            'lz4',
  'sasl_plain',       'sasl_scram',
  'plugins',          'zstd',
  'sasl_oauthbearer', 'http',
  'oidc'
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionA question is asked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions