title: Spring Kaka - Seek Offset from beginning
body: <p>I would like to consume messages from the beginning Offset. For this, I have added a property "seekToBeginning"=true in the properties file. My class that has the @KafkaListener implements ConsumerSeekAware and I have overriden the method onPartitionsAssigned() like the below. I would like to know if i'm doing it the right way. This method gets called 3 times (there are 3 partitions). Also, my worry is this method gets called when there is a CommitFailedException also. Pls let me know if the below if correct or should I filter by partition and how. Also pls let me know how to handle this in case of CommitFailedException.</p>
  
  <pre><code>    @Override
      public void onPartitionsAssigned(Map&lt;TopicPartition, Long&gt; assignments, ConsumerSeekCallback callback) {
          if (seekToBeginning)
          {
              assignments.forEach(
                      (topic, action) -&gt; callback.seekToBeginning(topic.topic(), topic.partition()));
          }
      }```
  </code></pre>