title: Spring Kafka consumer - manual commit with recovery callback mechanism
body: <p>I am building a kafka consumer. I have set the recovery callback similar to below. I have enabled manual commit. How can I acknowledge the message in recovery callback method so that there is no lag.</p>
  
  <pre><code>    @Bean
      public ConcurrentKafkaListenerContainerFactory&lt;String, Map&lt;String, Object&gt;&gt; kafkaListenerContainerFactory() {
          ConcurrentKafkaListenerContainerFactory&lt;String, Map&lt;String, Object&gt;&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
          factory.setConcurrency(conncurrency);
          factory.setConsumerFactory(consumerFactory());
          factory.setRetryTemplate(retryTemplate());
                  factory.setRecoveryCallback(new RecoveryCallback&lt;Object&gt;() {
          @Override
          public Object recover(RetryContext context) throws Exception {
              // TODO Auto-generated method stub
              logger.debug(" In recovery callback method !!");
              return null;
          }
      });
          factory.getContainerProperties().setAckMode(AckMode.MANUAL);
          return factory;
      }
  
      /*
       * Retry template.
       */
  
      protected RetryPolicy retryPolicy() {
          SimpleRetryPolicy policy = new SimpleRetryPolicy(maxRetryAttempts, retryableExceptions);
          return policy;
      }
  
      protected BackOffPolicy backOffPolicy() {
          ExponentialBackOffPolicy policy = new ExponentialBackOffPolicy();
          policy.setInitialInterval(initialRetryInterval);
          policy.setMultiplier(retryMultiplier);
          return policy;
      }
  
      protected RetryTemplate retryTemplate() {
         RetryTemplate template = new RetryTemplate();
         template.setRetryPolicy(retryPolicy());
         template.setBackOffPolicy(backOffPolicy());
         return template;
      }
  }
  </code></pre>