...
Kafka Consumer : Subscribing /Unsubscribing to Topics
Code Block | ||
---|---|---|
| ||
KafkaConsumer myConsumer = new KafkaConsumer(props);
myConsumer.subscribe(Array.asList("my_topic_A"));//take a collection of strings
myConsumer.unsubscribe(); |
Kafka Consumer : Assigning for partitions (vs subscribing)
We take on the responsibility of assigning ourselves specific partitions to a single consumer instance, regardless of topic.