You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ JSConsumer, JSProducer }=require("sinek");constconfig={clientId: "my-app",brokers: ["localhost:9092"],};asyncfunctionrun(){consttopic="my-topic";constproducer=newJSProducer(config);constconsumer=newJSConsumer(topic,config);producer.on("error",(error)=>console.error(error));consumer.on("error",(error)=>console.error(error));awaitconsumer.connect();// consume from a topic.consumer.consume(async(messages)=>{messages.forEach((message)=>{console.log(message);});});// Produce messages to a topic.awaitproducer.connect();producer.send(topic,"a message");}run()
And it simply returns me this:
const { "metadata.broker.list": brokerList, "client.id": clientId, "security.protocol": securityProtocol, "ssl.ca.location": sslCALocation, "ssl.certificate.location": sslCertLocation, "ssl.key.location": sslKeyLocation, "ssl.key.password": sslKeyPassword, "sasl.mechanisms": mechanism, "sasl.username": username, "sasl.password": password, } = config.noptions;
^
TypeError: Cannot destructure property 'metadata.broker.list' of 'config.noptions' as it is undefined.
at new JSProducer (/home/arantes/tmp/kafka-test/node_modules/sinek/dist/lib/kafkajs/JSProducer.js:72:41)
at run (/home/arantes/tmp/kafka-test/test.js:11:20)
at Object.<anonymous> (/home/arantes/tmp/kafka-test/test.js:32:1)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Module._load (node:internal/modules/cjs/loader:827:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
Node.js v18.0.0
The text was updated successfully, but these errors were encountered:
Tried the readme example:
And it simply returns me this:
The text was updated successfully, but these errors were encountered: