1
- const Kafka = require ( 'node-rdkafka ' ) ;
1
+ const Kafka = require ( '@confluentinc/kafka-javascript ' ) ;
2
2
const Client = require ( './client' ) ;
3
3
4
4
class KafkaProducer extends Client {
5
5
6
6
/**
7
7
* Initializes a KafkaProducer.
8
8
* @param {String } clientId: id to identify a client producing the message.
9
- * @param {import('node-rdkafka ').ProducerGlobalConfig } config: configs for producer.
10
- * @param {import('node-rdkafka ').ProducerTopicConfig } topicConfig: topic configs.
9
+ * @param {import('@confluentinc/kafka-javascript ').ProducerGlobalConfig } config: configs for producer.
10
+ * @param {import('@confluentinc/kafka-javascript ').ProducerTopicConfig } topicConfig: topic configs.
11
11
* @param {EventEmitter } emitter: to emit log messages
12
12
*/
13
13
constructor ( clientId , config , topicConfig , emitter ) {
@@ -85,10 +85,10 @@ class KafkaProducer extends Client {
85
85
/**
86
86
* Produce a message to a topic-partition.
87
87
* @param {String } topic: name of topic
88
- * @param {import('node-rdkafka ').NumberNullUndefined } partition: partition number to produce to.
88
+ * @param {import('@confluentinc/kafka-javascript ').NumberNullUndefined } partition: partition number to produce to.
89
89
* @param {any } message: message to be produced.
90
- * @param {import('node-rdkafka ').MessageKey } key: key associated with the message.
91
- * @param {import('node-rdkafka ').NumberNullUndefined } timestamp: timestamp to send with the message.
90
+ * @param {import('@confluentinc/kafka-javascript ').MessageKey } key: key associated with the message.
91
+ * @param {import('@confluentinc/kafka-javascript ').NumberNullUndefined } timestamp: timestamp to send with the message.
92
92
* @returns {import('../types').BooleanOrNumber }: returns boolean or librdkafka error code.
93
93
*/
94
94
produce ( { topic, message, partition = null , key = null , timestamp = null } ) {
@@ -105,7 +105,7 @@ class KafkaProducer extends Client {
105
105
/**
106
106
* Flush everything on the internal librdkafka buffer.
107
107
* Good to perform before disconnect.
108
- * @param {import('node-rdkafka ').NumberNullUndefined }} timeout
108
+ * @param {import('@confluentinc/kafka-javascript ').NumberNullUndefined }} timeout
109
109
* @param {import('../types').ErrorHandlingFunction } postFlushAction
110
110
* @returns {KafkaProducer }
111
111
*/
0 commit comments