node-kafka

ProducerStream producing only to single partition

試著忘記壹切 提交于 2020-01-16 08:28:52
问题 I am trying to produce some messages to a single topic having 2 partitions. All the messages are going to partition number 2 only. I would expect that a producer stream would distribute the messages across all partitions. const kafka = require('kafka-node') const { Transform } = require('stream'); const _ = require('lodash'); const client = new kafka.KafkaClient({ kafkaHost: 'localhost:9092' }) , streamproducer = new kafka.ProducerStream({kafkaClient: client}); const stdinTransform = new

ProducerStream producing only to single partition

≡放荡痞女 提交于 2020-01-16 08:28:33
问题 I am trying to produce some messages to a single topic having 2 partitions. All the messages are going to partition number 2 only. I would expect that a producer stream would distribute the messages across all partitions. const kafka = require('kafka-node') const { Transform } = require('stream'); const _ = require('lodash'); const client = new kafka.KafkaClient({ kafkaHost: 'localhost:9092' }) , streamproducer = new kafka.ProducerStream({kafkaClient: client}); const stdinTransform = new