Initializing producer in your Node.js application

Producer can be initialized using the following code sample in a Node.js app:

    var Kafka = require('no-kafka');
var brokerURLs = process.env.KAFKA_URL.replace(/+ssl/g,'');

var producer = new Kafka.Producer({
connectionString: brokerURLs,
ssl: {
certFile: './client.crt',
keyFile: './client.key'
}
});
producer.init();
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset