...
We take on the responsibility of assigning ourselves specific partitions to a single consumer instance, regardless of topic.
Code Block | ||
---|---|---|
| ||
//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 :