title: when to use RecoveryCallback vs KafkaListenerErrorHandler
body: <p>I'm trying to understand when should i use org.springframework.retry.RecoveryCallback and org.springframework.kafka.listener.KafkaListenerErrorHandler?</p>
  
  <p>As of today, I'm using a class (implements org.springframework.retry.RecoveryCallback) to log error message and send the message to DLT and it's working. For sending a message to DLT, I'm using Spring KafkaTemplate and then I came across KafkaListenerErrorHandler and DeadLetterPublishingRecoverer. Now, can you please suggest me, how should i use KafkaListenerErrorHandler and DeadLetterPublishingRecoverer? Can this replace the RecoveryCallback?</p>
  
  <p>Here is my current kafkaListenerContainerFactory code</p>
  
  <blockquote>
    <p>@Bean<br>
    public  ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory() {</p>
  
  <pre><code>ConcurrentKafkaListenerContainerFactory&lt;String, Object&gt; factory = new ConcurrentKafkaListenerContainerFactory&lt;&gt;();
  
  factory.setConsumerFactory(primaryConsumerFactory());
  factory.setRetryTemplate(retryTemplate());
  factory.setRecoveryCallback(recoveryCallback);
  factory.getContainerProperties().setAckMode(AckMode.RECORD);
  factory.setConcurrency(1);  
  factory.getContainerProperties().setMissingTopicsFatal(false);
  return factory;   }
  </code></pre>
  </blockquote>