Upgrade samples

This commit is contained in:
Gary Russell
2019-10-02 10:16:35 -04:00
committed by Artem Bilan
parent abdc1e136c
commit 0feba30e76
6 changed files with 22 additions and 13 deletions

View File

@@ -32,6 +32,7 @@ import org.springframework.kafka.listener.DeadLetterPublishingRecoverer;
import org.springframework.kafka.listener.SeekToCurrentErrorHandler;
import org.springframework.kafka.support.converter.RecordMessageConverter;
import org.springframework.kafka.support.converter.StringJsonMessageConverter;
import org.springframework.util.backoff.FixedBackOff;
import com.common.Foo2;
@@ -58,7 +59,7 @@ public class Application {
ConcurrentKafkaListenerContainerFactory<Object, Object> factory = new ConcurrentKafkaListenerContainerFactory<>();
configurer.configure(factory, kafkaConsumerFactory);
factory.setErrorHandler(new SeekToCurrentErrorHandler(
new DeadLetterPublishingRecoverer(template), 3)); // dead-letter after 3 tries
new DeadLetterPublishingRecoverer(template), new FixedBackOff(0L, 2))); // dead-letter after 3 tries
return factory;
}