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
Charlette
24 hours agoVal
6 days agoLucia
11 days agoJulie
16 days agoTitus
22 days agoJeannetta
27 days agoKimbery
2 months agoLynelle
2 months agoCassandra
2 months agoErin
2 months agoSanda
2 months agoAntonio
2 months agoJerry
3 months agoReuben
3 months agoStaci
3 months agoStephania
3 months agoNu
3 months agoTonette
3 months agoClaribel
4 months agoGracia
4 months agoMaryann
4 months agoMabelle
4 months agoJarod
4 months agoGwenn
5 months agoAshley
5 months ago