Class ConditionalDelegatingBatchErrorHandler
java.lang.Object
org.springframework.kafka.listener.ConditionalDelegatingBatchErrorHandler
- All Implemented Interfaces:
BatchErrorHandler,ConsumerAwareBatchErrorHandler,ContainerAwareBatchErrorHandler,GenericErrorHandler<org.apache.kafka.clients.consumer.ConsumerRecords<?,,?>> ListenerInvokingBatchErrorHandler
@Deprecated
public class ConditionalDelegatingBatchErrorHandler
extends Object
implements ListenerInvokingBatchErrorHandler
Deprecated.
An error handler that delegates to different error handlers, depending on the exception
type.
- Since:
- 2.7.4
-
Constructor Summary
ConstructorsConstructorDescriptionConditionalDelegatingBatchErrorHandler(ContainerAwareBatchErrorHandler defaultErrorHandler) Deprecated.Construct an instance with a default error handler that will be invoked if the exception has no matches. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDelegate(Class<? extends Throwable> throwable, ContainerAwareBatchErrorHandler handler) Deprecated.Add a delegate to the end of the current collection.protected voiddoHandle(Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container, Runnable invokeListener) Deprecated.voidhandle(Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container) Deprecated.Handle the exception.voidhandle(Exception thrownException, org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container, Runnable invokeListener) Deprecated.Handle the exception.voidsetErrorHandlers(Map<Class<? extends Throwable>, ContainerAwareBatchErrorHandler> delegates) Deprecated.Set the delegate error handlers; aLinkedHashMapargument 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, waitMethods inherited from interface org.springframework.kafka.listener.ConsumerAwareBatchErrorHandler
handleMethods inherited from interface org.springframework.kafka.listener.ContainerAwareBatchErrorHandler
handleMethods inherited from interface org.springframework.kafka.listener.GenericErrorHandler
clearThreadState, isAckAfterHandle, setAckAfterHandle
-
Constructor Details
-
ConditionalDelegatingBatchErrorHandler
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
public void setErrorHandlers(Map<Class<? extends Throwable>, ContainerAwareBatchErrorHandler> delegates) Deprecated.Set the delegate error handlers; aLinkedHashMapargument is recommended so that the delegates are searched in a known order.- Parameters:
delegates- the delegates.
-
addDelegate
public void addDelegate(Class<? extends Throwable> throwable, ContainerAwareBatchErrorHandler handler) 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 org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container) Deprecated.Description copied from interface:BatchErrorHandlerHandle the exception.- Specified by:
handlein interfaceBatchErrorHandler- Specified by:
handlein interfaceConsumerAwareBatchErrorHandler- Specified by:
handlein interfaceContainerAwareBatchErrorHandler- Specified by:
handlein interfaceListenerInvokingBatchErrorHandler- Parameters:
thrownException- the exception.records- the consumer records.consumer- the consumer.container- the container.
-
handle
public void handle(Exception thrownException, @Nullable org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container, Runnable invokeListener) Deprecated.Description copied from interface:ContainerAwareBatchErrorHandlerHandle the exception.- Specified by:
handlein interfaceBatchErrorHandler- Specified by:
handlein interfaceContainerAwareBatchErrorHandler- Specified by:
handlein interfaceListenerInvokingBatchErrorHandler- Parameters:
thrownException- the exception.records- the consumer records.consumer- the consumer.container- the container.invokeListener- a callback to re-invoke the listener.
-
doHandle
protected void doHandle(Exception thrownException, @Nullable org.apache.kafka.clients.consumer.ConsumerRecords<?, ?> records, org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, MessageListenerContainer container, @Nullable Runnable invokeListener) Deprecated.
-
CommonDelegatingErrorHandler.