title: How to know all the documents in a topic has been consumed by a Kafka consumer?
body: <p>I am trying to write a Kafka consumer where in I an streaming all the documents that are in a topic. And I want to close the Kafka consumer once all the documents have been consumed and I don't have any other documents to consume.</p>
  
  <p>Problem is since a consumer is supposed to continuously read and never stop, is there a way following which I can know that all the records in the Kafka topic has been consumed and committed so that I can close my consumer?</p>