@Override
    public void onPartitionsLost(Collection<TopicPartition> partitions) {
        Utils.printOut("Lost partitions: %s", partitions);
        // this is called when partitions are reassigned before we had a chance to revoke them gracefully
        // we can't commit pending offsets because these partitions are probably owned by other consumers already
        // nevertheless, we may need to do some other cleanup
    }
A simple consumer thread that subscribes to a topic, fetches new records and prints them.
The thread does not stop until all records are completed or an exception is raised.
examples/src/main/java/kafka/examples/Consumer.java