var kafka = require('kafka-node');
var HighLevelProducer = kafka.HighLevelProducer;
var Producer = kafka.Producer;
var conf='localhost1:2181';
var client = new kafka.Client(conf);
var producer = new Producer(client);
var msg = [
{ topic: 'test', messages: 'test msg', partition: 0 }
];
producer.on('ready', function () {
producer.send(msg, function (err) {
if (err) {
console.log(err);
}
})
});
it works good on localhost, but when we give wrong url, we would like to catch the error and
can you give us a sample producer connecting to Kafka using ssl with basic steps and with catching an error
Thanks for your contribution!
Questions?
Bug Report
Environment
For specific cases also provide
Include Sample Code to reproduce behavior
var kafka = require('kafka-node'); var HighLevelProducer = kafka.HighLevelProducer; var Producer = kafka.Producer; var conf='localhost1:2181'; var client = new kafka.Client(conf); var producer = new Producer(client); var msg = [ { topic: 'test', messages: 'test msg', partition: 0 } ]; producer.on('ready', function () { producer.send(msg, function (err) { if (err) { console.log(err); } }) });
Include output with Debug turned on
it works good on localhost, but when we give wrong url, we would like to catch the error and can you give us a sample producer connecting to Kafka using ssl with basic steps and with catching an error Thanks for your contribution!