Open clivedsouza1010 opened 4 years ago
Hi,
I have a topic with multiple partitions. I am trying to create a Consumer but not able to specify all partitions while creating it, for,eg,
Consumer
const consumer = new Consumer(kafkaClient, [{ topic: consumeTopic }], { groupId: 'kafka-node-group', autoCommit: false });
the above code just reads from partition 0. I tried something like,
const consumer = new Consumer(kafkaClient, [{ topic: consumeTopic, partition: '*' }], { groupId: 'kafka-node-group', autoCommit: false }); but, it did not work.
const consumer = new Consumer(kafkaClient, [{ topic: consumeTopic, partition: '*' }], { groupId: 'kafka-node-group', autoCommit: false });
Can someone help me out. Thanks
// include code here
Thanks for your contribution!
Using ConsumerGroup lets you fetch data from all the partitions.
Bug Report
Hi,
I have a topic with multiple partitions. I am trying to create a
Consumer
but not able to specify all partitions while creating it, for,eg,const consumer = new Consumer(kafkaClient, [{ topic: consumeTopic }], { groupId: 'kafka-node-group', autoCommit: false });
the above code just reads from partition 0. I tried something like,
const consumer = new Consumer(kafkaClient, [{ topic: consumeTopic, partition: '*' }], { groupId: 'kafka-node-group', autoCommit: false });
but, it did not work.Can someone help me out. Thanks
Environment
For specific cases also provide
Include Sample Code to reproduce behavior
Include output with Debug turned on
Thanks for your contribution!