A consumer wants to read messages from partitions 0 and 1 of a topic topic1. Code snippet is shown below.
consumer.subscribe(Arrays.asList("topic1"));
List
pc.add(new PartitionTopic("topic1", 0));
pc.add(new PartitionTopic("topic1", 1));
consumer.assign(pc);
subscribe() and assign() cannot be called by the same consumer, subscribe() is used to leverage the consumer group mechanism, while assign() is used to manually control partition assignment and reads assignment
Kimbery
9 hours agoLynelle
6 days agoCassandra
11 days agoErin
16 days agoSanda
21 days agoAntonio
26 days agoJerry
1 month agoReuben
1 month agoStaci
1 month agoStephania
2 months agoNu
2 months agoTonette
2 months agoClaribel
2 months agoGracia
2 months agoMaryann
2 months agoMabelle
3 months agoJarod
3 months agoGwenn
3 months agoAshley
3 months ago