0

I tried this code but it is consuming from other partitions as well but my req is to consume from 1 and 2 partition

          ConsumerKafka.subscribe(topic_list)
          ConsumerKafka.assign([TopicPartition(topic_name, 1, 2)])
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

1 Answers1

0

You need to remove subscribe call to consume from only specific partitions

Also, you need two element list

[TopicPartition(topic_name, p) for p in [1,2]]

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245