Class SendToDlqAndContinue

java.lang.Object
org.springframework.cloud.stream.binder.kafka.streams.SendToDlqAndContinue
All Implemented Interfaces:
BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,Exception>, org.springframework.kafka.listener.ConsumerRecordRecoverer

public class SendToDlqAndContinue extends Object implements org.springframework.kafka.listener.ConsumerRecordRecoverer
Custom implementation for ConsumerRecordRecoverer that keeps a collection of recoverer objects per input topics. These topics might be per input binding or multiplexed topics in a single binding.
Since:
2.0.0
Author:
Soby Chacko
  • Constructor Details

    • SendToDlqAndContinue

      public SendToDlqAndContinue()
  • Method Details

    • sendToDlq

      public void sendToDlq(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> consumerRecord, Exception exception)
      For a given topic, send the key/value record to DLQ topic.
      Parameters:
      consumerRecord - consumer record
      exception - exception
    • accept

      public void accept(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> consumerRecord, Exception e)
      Specified by:
      accept in interface BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,Exception>