Giriş
Şu satırı dahil ederiz
Şöyle yaparızimport org.springframework.kafka.listener.DeadLetterPublishingRecoverer;
@Bean(name = "invoiceDltContainerFactory")public ConcurrentKafkaListenerContainerFactory<Object, Object> listenerContainerFactory(ConcurrentKafkaListenerContainerFactoryConfigurer configurer,KafkaTemplate<String, String> kafkaTemplate) {var factory = new ConcurrentKafkaListenerContainerFactory<Object, Object>();configurer.configure(factory, consumerFactory());var recoverer = new DeadLetterPublishingRecoverer(kafkaTemplate,(record, ex) -> new TopicPartition("t-invoice-dead", record.partition()));factory.setCommonErrorHandler(new DefaultErrorHandler(recoverer, new FixedBackOff(1000,5)));return factory;}
Hiç yorum yok:
Yorum Gönder