title: Kafka consumer is reading last committed offset on re-start (Java)
body: <p>I have a kakfa consumer for which <em><b>enable.auto.commit</b></em> is set to <em><b>false</b></em>. Whenever I re-start my consumer application, it always reads the last committed offset again and then the next offsets.</p>
  
  <p>For ex. Last committed offset is 50. When I restart consumer, it again reads offset 50 first and then the next offsets.</p>
  
  <p>I am performing commitsync as shown below.</p>
  
  <pre><code>Map&lt;TopicPartition, OffsetAndMetadata&gt; offsets = new HashMap&lt;&gt;();
  offsets.put(new TopicPartition("sometopic", partition), new OffsetAndMetadata(offset));
  kafkaconsumer.commitSync(offsets);
  </code></pre>
  
  <p>I tried setting <em><b>auto.offset.reset</b></em> to <em><b>earliest</b></em> and <em><b>latest</b></em> but it is not changing the behavior.</p>
  
  <p>Am I missing something here in consumer configuration ?</p>
  
  <pre><code>config.put(ConsumerConfig.CLIENT_ID_CONFIG, "CLIENT_ID");
  config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092");
  config.put(ConsumerConfig.GROUP_ID_CONFIG, "GROUP_ID");
  config.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, "false");
  config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,StringDeserializer.class.getName());
  config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,CustomDeserializer.class.getName());
  config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest");
  </code></pre>