1- const Kafka = require ( 'node-rdkafka ' ) ;
1+ const Kafka = require ( '@confluentinc/kafka-javascript ' ) ;
22const Client = require ( './client' ) ;
33
44class KafkaProducer extends Client {
55
66 /**
77 * Initializes a KafkaProducer.
88 * @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.
1111 * @param {EventEmitter } emitter: to emit log messages
1212 */
1313 constructor ( clientId , config , topicConfig , emitter ) {
@@ -85,10 +85,10 @@ class KafkaProducer extends Client {
8585 /**
8686 * Produce a message to a topic-partition.
8787 * @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.
8989 * @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.
9292 * @returns {import('../types').BooleanOrNumber }: returns boolean or librdkafka error code.
9393 */
9494 produce ( { topic, message, partition = null , key = null , timestamp = null } ) {
@@ -105,7 +105,7 @@ class KafkaProducer extends Client {
105105 /**
106106 * Flush everything on the internal librdkafka buffer.
107107 * Good to perform before disconnect.
108- * @param {import('node-rdkafka ').NumberNullUndefined }} timeout
108+ * @param {import('@confluentinc/kafka-javascript ').NumberNullUndefined }} timeout
109109 * @param {import('../types').ErrorHandlingFunction } postFlushAction
110110 * @returns {KafkaProducer }
111111 */
0 commit comments