new ProducerStream(producer, topics, options)
Writable stream integrating with the Kafka Producer. This class is used to write data to Kafka in a streaming way. It takes buffers of data and puts them into the appropriate Kafka topic. If you need finer control over partitions or keys, this is probably not the class for you. In that situation just use the Producer itself. The stream detects if Kafka is already connected. You can safely begin writing right away. This stream does not operate in Object mode and can only be given buffers.
Parameters:
Name | Type | Description |
---|---|---|
producer | Producer | The Kafka Producer object. |
topics | array | Array of topics |
options | object | Topic configuration. |
- Source:
Extends:
- stream.Writable