Interface ListenerContainerWithDlqAndRetryCustomizer

All Superinterfaces:
ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>>

public interface ListenerContainerWithDlqAndRetryCustomizer extends ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>>
An extension of ListenerContainerCustomizer that provides access to dead letter metadata.
Since:
3.2
Author:
Gary Russell
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    configure(org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?> container, String destinationName, String group)
     
    void
    configure(org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?> container, String destinationName, String group, BiFunction<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,Exception,org.apache.kafka.common.TopicPartition> dlqDestinationResolver, org.springframework.util.backoff.BackOff backOff)
    Configure the container.
    default boolean
    retryAndDlqInBinding(String destinationName, String group)
    Return false to move retries and DLQ from the binding to a customized error handler using the retry metadata and/or a DeadLetterPublishingRecoverer when configured via configure(AbstractMessageListenerContainer, String, String, BiFunction, BackOff).
  • Method Details

    • configure

      default void configure(org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?> container, String destinationName, String group)
      Specified by:
      configure in interface ListenerContainerCustomizer<org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?>>
    • configure

      void configure(org.springframework.kafka.listener.AbstractMessageListenerContainer<?,?> container, String destinationName, String group, @Nullable BiFunction<org.apache.kafka.clients.consumer.ConsumerRecord<?,?>,Exception,org.apache.kafka.common.TopicPartition> dlqDestinationResolver, @Nullable org.springframework.util.backoff.BackOff backOff)
      Configure the container.
      Parameters:
      container - the container.
      destinationName - the destination name.
      group - the group.
      dlqDestinationResolver - a destination resolver for the dead letter topic (if enableDlq).
      backOff - the backOff using retry properties (if configured).
      See Also:
    • retryAndDlqInBinding

      default boolean retryAndDlqInBinding(String destinationName, String group)
      Return false to move retries and DLQ from the binding to a customized error handler using the retry metadata and/or a DeadLetterPublishingRecoverer when configured via configure(AbstractMessageListenerContainer, String, String, BiFunction, BackOff).
      Parameters:
      destinationName - the destination name.
      group - the group.
      Returns:
      true to disable retrie in the binding