Using DeadLetterPublishingRecoverer with ReactiveKafkaConsumerTemplate

Viewed 32

I started looking into using a DeadLetterPublishingRecoverer for my kafka consumer factory common error handler. However, it seems that in order to instantiate an instance of this class, 1 option is to pass in a KafkaOperations<? extends Object, ? extends object> template. From previous examples, most seem to simply pass in a KafkaTemplate<>. However, I am using the reactive version of kafka for both the consumer & producer templates. So, I am not sure if it is somehow possible to use the ReactiveKafkaConsumerTemplate<> for this use case?

public ConcurrentKafkaListenerContainerFactory<String, Object> kafkaListenerFactory() {
    ConcurrentKafkaListenerContainerFactory<String, Object> factory = new ConcurrentKafkaListenerContainerFactory<>();
    factory.setCommonErrorHandler(new DefaultErrorHandler(new DeadLetterPublishingRecoverer( **HERE** ), ...));
    ...
}
1 Answers

The DLPR is not designed for use with the reactive template.

Related