title: KafkaConsumer poll() behavior understanding
body: <p>Trying to understand (new to kafka)how the poll event loop in kafka works.</p>
  <p>Use Case : 25 records on the topic, max poll size is set to 5.</p>
  <p><code>max.poll.interval.ms = 5000   //5 seconds by default max.poll.records = 5</code></p>
  <p>Sequence of tasks</p>
  <ol>
  <li>Poll the records from the topic.</li>
  <li>Process the records in a for loop.</li>
  <li>Some processing login where the logic would either pass or fail.</li>
  <li>If logic passes (with offset) will be added to a map.</li>
  <li>Then it will be committed using commitSync call.</li>
  <li><strong>If fails then the loop will break and whatever was success before this would be committed.The problem starts after this.</strong></li>
  <li><strong>The next poll would just keep moving in batches of 5 even after error, is it expected?</strong></li>
  </ol>
  <p>What we basically expect is that the loop breaks and the offsets till success process message logic should get committed, then the next poll should continue from the failed message.</p>
  <p>Example, 1st batch of poll 5 messages polled and 1,2 offsets successful and committed then 3rd failed.So the poll call keep moving to next batch like 5-10,10-15 if there are any errors in between we expect it to stop at that point and poll should start from 3 in first case or if it fails in 2nd batch at 8 then the next poll should start from 8th offset not from next max poll batch settings which would be like 5 in this case.IF IT MATTERS USING SPRING BOOT PROJECT and enable autocommit is false.</p>
  <p>I have tried finding this in documentation but no help.</p>
  <p>tried tweaking this but no help <code>max.poll.interval.ms</code></p>
  <p><strong>EDIT: Not accepted answer because there is no direct solution for a customer consumer.Keeping this for informational purpose</strong></p>