public class ConsumerApp {
public static void main(String[] args){
// Create the Properties class to instantiate the Consumer with the desired settings:
Properties props = new Properties();
//A list of host/port pairs to use for establishing the initial connection to the Kafka cluster.
props.put("bootstrap.servers", "localhost:9092, localhost:9093");
//Serializer class for key that implements the Serializer interface.
props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
//Serializer class for value that implements the Serializer interface.
props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
//The minimum amount of data the server should return for a fetch request.
props.put("fetch.min.bytes", 1);
//A unique string that identifies the consumer group this consumer belongs to.
props.put("group.id", "");
// Create a KafkaConsumer instance and configure it with properties.
KafkaConsumer<String, String> myConsumer = new KafkaConsumer<String, String>(props);
// Create a topic subscription list:
ArrayList<TopicPartition> partition