title: KafkaConsumer.close() Why?
body: <p>I am here asking about closing a kafka consumer. Do I need to close kafka consumer even if the using thread exits? Would not closing it leak resources by any change? </p>
  
  <p>Here is a code example: </p>
  
  <pre><code>public class MyThread extends Thread{
  
      private KafkaConsumer&lt;String, Message&gt; kafkaConsumer;
  
  
      @Override
      public void run() {
          kafkaConsumer = initConsumer();
          while(true){
              kafkaconsumer.poll(1000000)
              //Code goes here.
          }
      }
  }
  </code></pre>
  
  <p>Does the <code>kafkaConsumer</code> close when <code>MyThread</code> exits using <code>System.exit</code>?</p>