Class ConditionalDelegatingErrorHandler
java.lang.Object
org.springframework.kafka.listener.ConditionalDelegatingErrorHandler
- All Implemented Interfaces:
ConsumerAwareErrorHandler
,ContainerAwareErrorHandler
,ErrorHandler
,GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecord<?,
,?>> RemainingRecordsErrorHandler
@Deprecated
public class ConditionalDelegatingErrorHandler
extends Object
implements ContainerAwareErrorHandler
Deprecated.
An error handler that delegates to different error handlers, depending on the exception
type.
- Since:
- 2.7.4
- Author:
- Gary Russell
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalDelegatingErrorHandler
(ContainerAwareErrorHandler defaultErrorHandler) Deprecated.Construct an instance with a default error handler that will be invoked if the exception has no matches. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDelegate
(Class<? extends Throwable> throwable, ContainerAwareErrorHandler handler) Deprecated.Add a delegate to the end of the current collection.void
handle
(Exception thrownException, List<org.apache.kafka.clients.consumer.ConsumerRecord<?, ?>> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container) Deprecated.Handle the exception.void
setErrorHandlers
(Map<Class<? extends Throwable>, ContainerAwareErrorHandler> delegates) Deprecated.Set the delegate error handlers; aLinkedHashMap
argument is recommended so that the delegates are searched in a known order.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.kafka.listener.ConsumerAwareErrorHandler
handle
Methods inherited from interface org.springframework.kafka.listener.ContainerAwareErrorHandler
handle
Methods inherited from interface org.springframework.kafka.listener.GenericErrorHandler
clearThreadState, isAckAfterHandle, setAckAfterHandle
Methods inherited from interface org.springframework.kafka.listener.RemainingRecordsErrorHandler
handle
-
Constructor Details
-
ConditionalDelegatingErrorHandler
Deprecated.Construct an instance with a default error handler that will be invoked if the exception has no matches.- Parameters:
defaultErrorHandler
- the default error handler.
-
-
Method Details
-
setErrorHandlers
Deprecated.Set the delegate error handlers; aLinkedHashMap
argument is recommended so that the delegates are searched in a known order.- Parameters:
delegates
- the delegates.
-
addDelegate
Deprecated.Add a delegate to the end of the current collection.- Parameters:
throwable
- the throwable for this handler.handler
- the handler.
-
handle
public void handle(Exception thrownException, @Nullable List<org.apache.kafka.clients.consumer.ConsumerRecord<?, ?>> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container) Deprecated.Description copied from interface:ErrorHandler
Handle the exception.- Specified by:
handle
in interfaceConsumerAwareErrorHandler
- Specified by:
handle
in interfaceContainerAwareErrorHandler
- Specified by:
handle
in interfaceErrorHandler
- Specified by:
handle
in interfaceRemainingRecordsErrorHandler
- Parameters:
thrownException
- the exception.records
- the remaining records including the one that failed.consumer
- the consumer.container
- the container.
-
CommonDelegatingErrorHandler
.