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 TypeMethodDescriptiondefault voidconfigure(org.springframework.kafka.listener.AbstractMessageListenerContainer<?, ?> container, String destinationName, String group) voidconfigure(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 booleanretryAndDlqInBinding(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 aDeadLetterPublishingRecovererwhen configured viaconfigure(AbstractMessageListenerContainer, String, String, BiFunction, BackOff).
-
Method Details
-
configure
default void configure(org.springframework.kafka.listener.AbstractMessageListenerContainer<?, ?> container, String destinationName, String group) - Specified by:
configurein interfaceListenerContainerCustomizer<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
Return false to move retries and DLQ from the binding to a customized error handler using the retry metadata and/or aDeadLetterPublishingRecovererwhen configured viaconfigure(AbstractMessageListenerContainer, String, String, BiFunction, BackOff).- Parameters:
destinationName- the destination name.group- the group.- Returns:
- true to disable retrie in the binding
-