Class KafkaErrorSendingMessageRecoverer

java.lang.Object
org.springframework.integration.core.ErrorMessagePublisher
org.springframework.integration.kafka.inbound.KafkaErrorSendingMessageRecoverer
All Implemented Interfaces:
BiConsumer<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,Exception>, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.kafka.listener.ConsumerRecordRecoverer

public class KafkaErrorSendingMessageRecoverer extends org.springframework.integration.core.ErrorMessagePublisher implements org.springframework.kafka.listener.ConsumerRecordRecoverer
An extension of ErrorMessagePublisher that can be used in a CommonErrorHandler for recovering Kafka delivery failures.
Since:
6.0
  • Field Summary

    Fields inherited from class org.springframework.integration.core.ErrorMessagePublisher

    logger, messagingTemplate
  • Constructor Summary

    Constructors
    Constructor
    Description
    KafkaErrorSendingMessageRecoverer(org.springframework.messaging.MessageChannel channel)
    Construct an instance to send to the channel with the RawRecordHeaderErrorMessageStrategy.
    KafkaErrorSendingMessageRecoverer(org.springframework.messaging.MessageChannel channel, org.springframework.integration.support.ErrorMessageStrategy errorMessageStrategy)
    Construct an instance to send the channel, using the error message strategy.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(org.apache.kafka.clients.consumer.ConsumerRecord<?,?> record, Exception ex)
     

    Methods inherited from class org.springframework.integration.core.ErrorMessagePublisher

    determinePayload, getChannel, getChannelResolver, getErrorMessageStrategy, getMessagingTemplate, payloadWhenNull, publish, publish, publish, publish, publish, setBeanFactory, setChannel, setChannelName, setChannelResolver, setErrorMessageStrategy, setSendTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.BiConsumer

    andThen
  • Constructor Details

    • KafkaErrorSendingMessageRecoverer

      public KafkaErrorSendingMessageRecoverer(org.springframework.messaging.MessageChannel channel)
      Construct an instance to send to the channel with the RawRecordHeaderErrorMessageStrategy.
      Parameters:
      channel - the channel.
    • KafkaErrorSendingMessageRecoverer

      public KafkaErrorSendingMessageRecoverer(org.springframework.messaging.MessageChannel channel, org.springframework.integration.support.ErrorMessageStrategy errorMessageStrategy)
      Construct an instance to send the channel, using the error message strategy.
      Parameters:
      channel - the channel.
      errorMessageStrategy - the strategy.
  • Method Details

    • accept

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