title: Seek to end of partition while running kafka spring using Group management?
body: <p>I'm using a kafka spring consumer that is under group management.</p>
  
  <p>I have the following code in my consumer class</p>
  
  <pre><code>public class ConsumerHandler implements Receiver&lt;String, Message&gt;, ConsumerSeekAware {
  
      @Value("${topic}")
      protected String topic;
  
      public ConsumerHandler(){}
  
  
      @KafkaListener(topics = "${topic}")
      public Message receive(List&lt;ConsumerRecord&lt;String, Message&gt;&gt; messages, Acknowledgment acknowledgment) {
  
          for (ConsumerRecord&lt;String, Message&gt; message : messages) {
              Message msg = message.value();                    
              this.handleMessage(any, message);
          }
  
          acknowledgment.acknowledge();
  
          return null;
      }
  
  
  
      @Override
      public void registerSeekCallback(ConsumerSeekCallback callback) {
      }
  
      @Override
      public void onPartitionsAssigned(Map&lt;TopicPartition, Long&gt; assignments, ConsumerSeekCallback callback) {
  
              for (Entry&lt;TopicPartition, Long&gt; pair : assignments.entrySet()) {
                  TopicPartition tp = pair.getKey();
                  callback.seekToEnd(tp.topic(),tp.partition());
              }           
  
      }
  
      @Override
      public void onIdleContainer(Map&lt;TopicPartition, Long&gt; assignments, ConsumerSeekCallback callback) {}
  }
  </code></pre>
  
  <p>This code works great while my consumer is running. However, sometimes the amount of messages being processed is too much and the messages stack up. I've implemented concurrency on my consumers and still sometimes there's delay in the messages over time. </p>
  
  <p>So as a workaround, before I figure out why the delay is happening, I'm trying to keep my consumer up to the latest messages.</p>
  
  <p>I'm having to restart my app to get partition assigned invoked so that my consumer seeks to end and starts processing the latest messages.</p>
  
  <p>Is there a way to seek to end without having to bounce my application?</p>
  
  <p>Thanks.</p>