Class RecoveringProcessingExceptionHandler
java.lang.Object
org.springframework.kafka.streams.AbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response>
org.springframework.kafka.streams.RecoveringProcessingExceptionHandler
- All Implemented Interfaces:
org.apache.kafka.common.Configurable, org.apache.kafka.streams.errors.ProcessingExceptionHandler
public class RecoveringProcessingExceptionHandler
extends AbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response>
implements org.apache.kafka.streams.errors.ProcessingExceptionHandler
A
ProcessingExceptionHandler that calls a ConsumerRecordRecoverer
or uses the native Kafka Streams DLQ and continues.- Since:
- 4.1
- Author:
- Loïc Greffier
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kafka.streams.errors.ProcessingExceptionHandler
org.apache.kafka.streams.errors.ProcessingExceptionHandler.ProcessingHandlerResponse, org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response, org.apache.kafka.streams.errors.ProcessingExceptionHandler.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name for configuring the native DLQ destination resolver.static final StringProperty name for configuring the recoverer using properties.Fields inherited from class AbstractRecoveringExceptionHandler
deadLetterRecordManager, deadLetterTopic, destinationResolver, recoverer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected org.apache.kafka.streams.errors.ProcessingExceptionHandler.Responsefail()Create a response indicating that processing should fail.org.apache.kafka.streams.errors.ProcessingExceptionHandler.ResponsehandleError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.streams.processor.api.Record<?, ?> record, Exception exception) protected org.apache.kafka.streams.errors.ProcessingExceptionHandler.ResponseCreate a response indicating that processing should resume.Methods inherited from class AbstractRecoveringExceptionHandler
configureCommon, handleErrorCommonMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.streams.errors.ProcessingExceptionHandler
handle
-
Field Details
-
RECOVERER
Property name for configuring the recoverer using properties.- See Also:
-
DLQ_DESTINATION_RESOLVER
Property name for configuring the native DLQ destination resolver.- See Also:
-
-
Constructor Details
-
RecoveringProcessingExceptionHandler
public RecoveringProcessingExceptionHandler()
-
-
Method Details
-
handleError
public org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response handleError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.streams.processor.api.Record<?, ?> record, Exception exception) - Specified by:
handleErrorin interfaceorg.apache.kafka.streams.errors.ProcessingExceptionHandler
-
configure
-
fail
protected org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response fail()Create a response indicating that processing should fail.- Specified by:
failin classAbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response>- Returns:
- a handler-specific fail response
-
resume
protected org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response resume(List<org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>> deadLetterRecords) Create a response indicating that processing should resume.- Specified by:
resumein classAbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProcessingExceptionHandler.Response>- Parameters:
deadLetterRecords- The list of dead letter records to forward to DLQ- Returns:
- a handler-specific resume response
-