public void shutdown() {
        if (!closed) {
            closed = true;
            latch.countDown();
        }
    }
This class implements a read-process-write application.
examples/src/main/java/kafka/examples/ExactlyOnceMessageProcessor.java