public void shutdown() {
        if (!closed) {
            closed = true;
            latch.countDown();
        }
    }
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