Closed SaiManikantaG closed 4 months ago
Hi,
This block is not as expected:
const { Kafka } = require('@confluentinc/kafka-javascript').KafkaJS
const kafka = new Client({
KafkaJS: {
brokers: ["xxxxxxxxxx"],
ssl: true,
sasl: {
mechanism: "plain",
username: "xxxxxxx",
password:
"yyyyyyyyyyyyy",
},
},
});
You can use this if you want the new API (this is the block on README.md)
const { Kafka } = require('@confluentinc/kafka-javascript').KafkaJS
const kafka = new Kafka({
kafkaJS: {
brokers: ['<fill>'],
ssl: true,
sasl: {
mechanism: 'plain',
username: '<fill>',
password: '<fill>',
},
}
});
const producer = kafka.producer();
// and then hereafter...
Check this: https://github.com/confluentinc/confluent-kafka-javascript?tab=readme-ov-file#getting-started
hello thanks for the reply, I might've mistakenly posted the client as an example but I tried with different values at the place and still had the same issue. Please find the details here, I removed my node modules and ran the npm install again
@SaiManikantaG try changing the syntax on line 10 from KafkaJS
to kafkaJS
. That should fix it
@nhaq-confluent that fixed the issue. Thank you :)
Environment Information
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 messageconfluent-kafka-javascript Configuration Settings
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.
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
Result: