Consuming messages is similar with producing messages because of abstraction offered by kafka library. There are two methods for consuming messages, subscribe(List<String>) can be used to consume messages from one or more topics, assign(List<TopicPartition>) should be used when we are interested to consume messages from specific partitions.
DIN BLOGURILE MOLDOVEI