title: What determines Kafka consumer offset?
body: <p>I am relatively new to Kafka. I have done a bit of experimenting with it, but a few things are unclear to me regarding consumer offset. From what I have understood so far, when a consumer starts, the offset it will start reading from is determined by the configuration setting <code>auto.offset.reset</code> (correct me if I am wrong).</p>
  <p>Now say for example that there are 10 messages (offsets 0 to 9) in the topic, and a consumer happened to consume 5 of them before it went down (or before I killed the consumer). Then say I restart that consumer process. My questions are:</p>
  <ol>
  <li><p>If the <code>auto.offset.reset</code> is set to <code>earliest</code>, is it always going to start consuming from offset 0 ?</p>
  </li>
  <li><p>If the <code>auto.offset.reset</code> is set to <code>latest</code>, is it going to start consuming from offset 5 ?</p>
  </li>
  <li><p>Is the behaviour regarding this kind of scenario always deterministic ?</p>
  </li>
  </ol>
  <p>Please don't hesitate to comment if anything in my question is unclear.</p>