title: Can't get kafka consumer records with AUTO_OFFSET_RESET_CONFIG = "latest"
body: <p>I have a test automation project. I'm trying to get kafka consumer records starting from the latest record with config <code>ConsumerConfig.AUTO_OFFSET_RESET_CONFIG = &quot;latest&quot;</code>. But it doesn't work. Here is a code where I'm trying to poll data:</p>
  <pre><code>for(int i=0; i&lt;20; i++) {
              ConsumerRecords&lt;String, String&gt; consumerRecords = consumer.poll(Duration.ofMillis(500L));
              value = findValue(key, consumerRecords);
              if(value != null){
                  break;
              }
          }
  </code></pre>
  <p>In this code variable <code>consumerRecords</code> has 0 size in every iteration.</p>
  <p>If I change <code>ConsumerConfig.AUTO_OFFSET_RESET_CONFIG</code> to <code>&quot;earliest&quot;</code> then <code>consumer.poll()</code> works and variable <code>consumerRecords</code> has not 0 size, but elements in collection are starting since earliest offset, while I need elements which are starting since last offset.</p>
  <p>How I can achieve <code>consumerRecords</code> with elements in decreasing order by offset ?</p>
  <p>I tried to increase the timeout to polling up to 10 seconds - it didn't help.</p>
  <p>kafka-clients:2.7.0</p>