quintoandar-kafka
Advanced tools
Comparing version 0.0.12 to 0.0.13
{ | ||
"name": "quintoandar-kafka", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Default Kafka NodeJS lib for QuintoAndar", | ||
@@ -5,0 +5,0 @@ "main": "src/main.js", |
@@ -28,3 +28,3 @@ const kafka = require('kafka-node'); | ||
this.client = new kafka.KafkaClient(this.configs); | ||
this.producer = new kafka.HighLevelProducer(this.client, this.configs); | ||
this.producer = new kafka.HighLevelProducer(this.client); | ||
this.producer.on('error', logger.error); | ||
@@ -48,3 +48,2 @@ this.readyPromisse = new Promise((resolve) => { | ||
this.producer.send([payload], (err, data) => { | ||
logger.debug(data); | ||
if (err) { | ||
@@ -51,0 +50,0 @@ reject(err); |
@@ -36,3 +36,2 @@ jest.mock('node-rdkafka'); | ||
expect(producer.client.configs).toEqual(fullConfigs); | ||
expect(producer.producer.configs).toEqual(fullConfigs); | ||
expect(producer.producer.client).toBe(producer.client); | ||
@@ -39,0 +38,0 @@ done(); |
@@ -15,2 +15,13 @@ import { Writable } from 'stream'; | ||
init(): void | ||
} | ||
export class KafkaProducerOptions { | ||
configs: KafkaClientOptions; | ||
topic: string; | ||
} | ||
export class KafkaProducer { | ||
constructor(options: KafkaProducerOptions) | ||
send(msg: string): Promise<string>; | ||
} |
17901
482