Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private createProducer(topic: string) {
const producer = Kafka.createWriteStream(
Object.assign({}, {'metadata.broker.list': this.brokerList()}, this.options.globalConfig),
{},
{topic}
);
producer.on('error', (err) => {
this.logger.error(err, 'Error in our kafka stream')
})
return producer
}
KafkaPubSub.prototype.createProducer = function (topic) {
var _this = this;
var producer = Kafka.createWriteStream(Object.assign({}, { 'metadata.broker.list': this.brokerList() }, this.options.globalConfig), {}, { topic: topic });
producer.on('error', function (err) {
_this.logger.error(err, 'Error in our kafka stream');
});
return producer;
};
KafkaPubSub.prototype.createConsumer = function (topic) {