title: Spring Kafka - How to reset offset to latest with a group id?
body: <p>
  I am currently using Spring Integration Kafka to make real-time statistics. Though, the group name makes Kafka search all the previous values the listener didn't read.</p>
  
  <pre><code>@Value("${kafka.consumer.group.id}")
  private String consumerGroupId;
  
  @Bean
  public ConsumerFactory&lt;String, String&gt; consumerFactory() {
      return new DefaultKafkaConsumerFactory&lt;&gt;(getDefaultProperties());
  }
  
  public Map&lt;String, Object&gt; getDefaultProperties() {
      Map&lt;String, Object&gt; properties = new HashMap&lt;&gt;();
      properties.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
  
      properties.put(ConsumerConfig.GROUP_ID_CONFIG, consumerGroupId);
  
      properties.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
      properties.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, ByteArrayDeserializer.class);
      return properties;
  }
  
  @Bean
  public ConcurrentKafkaListenerContainerFactory&lt;String, String&gt; kafkaListenerContainerFactory() {
  
      ConcurrentKafkaListenerContainerFactory&lt;String, String&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
      factory.setConsumerFactory(consumerFactory());
      return factory;
  }
  
  @Bean
  public KafkaMessageListener listener() {
      return new KafkaMessageListener();
  }
  </code></pre>
  
  
  
  
  
  <p>I would like to begin to the latest offset, and not be bothered by old values. Is there a possibility to reset the offset of the group ?</p>