Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

We take on the responsibility of assigning ourselves specific partitions to a single consumer instance, regardless of topic.

Code Block
languagejava
//Similar pattern as subcribe();
// Manual PArtition Assignment
TopicPartition partition0 = new TopicPartition("my_topic_A", 0);
ArrayList<TopicPartition> partitions = new ArrayLis<TopicPartition>();
partitions.add(partition0);

//Invoke the assign() method
myConsumer.assign(partitions); //This is not incremental

Kafka Consumer :