Class RecoveringProductionExceptionHandler
java.lang.Object
org.springframework.kafka.streams.AbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProductionExceptionHandler.Response>
org.springframework.kafka.streams.RecoveringProductionExceptionHandler
- All Implemented Interfaces:
org.apache.kafka.common.Configurable, org.apache.kafka.streams.errors.ProductionExceptionHandler
public class RecoveringProductionExceptionHandler
extends AbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProductionExceptionHandler.Response>
implements org.apache.kafka.streams.errors.ProductionExceptionHandler
A
ProductionExceptionHandler 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.ProductionExceptionHandler
org.apache.kafka.streams.errors.ProductionExceptionHandler.ProductionExceptionHandlerResponse, org.apache.kafka.streams.errors.ProductionExceptionHandler.Response, org.apache.kafka.streams.errors.ProductionExceptionHandler.Result, org.apache.kafka.streams.errors.ProductionExceptionHandler.SerializationExceptionOrigin -
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.ProductionExceptionHandler.Responsefail()Create a response indicating that processing should fail.org.apache.kafka.streams.errors.ProductionExceptionHandler.ResponsehandleError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]> record, Exception exception) org.apache.kafka.streams.errors.ProductionExceptionHandler.ResponsehandleSerializationError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord record, Exception exception, org.apache.kafka.streams.errors.ProductionExceptionHandler.SerializationExceptionOrigin origin) protected org.apache.kafka.streams.errors.ProductionExceptionHandler.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.ProductionExceptionHandler
handle, handle, handleSerializationException, handleSerializationException
-
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
-
RecoveringProductionExceptionHandler
public RecoveringProductionExceptionHandler()
-
-
Method Details
-
handleError
public org.apache.kafka.streams.errors.ProductionExceptionHandler.Response handleError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]> record, Exception exception) - Specified by:
handleErrorin interfaceorg.apache.kafka.streams.errors.ProductionExceptionHandler
-
handleSerializationError
public org.apache.kafka.streams.errors.ProductionExceptionHandler.Response handleSerializationError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord record, Exception exception, org.apache.kafka.streams.errors.ProductionExceptionHandler.SerializationExceptionOrigin origin) - Specified by:
handleSerializationErrorin interfaceorg.apache.kafka.streams.errors.ProductionExceptionHandler
-
configure
-
fail
protected org.apache.kafka.streams.errors.ProductionExceptionHandler.Response fail()Create a response indicating that processing should fail.- Specified by:
failin classAbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.ProductionExceptionHandler.Response>- Returns:
- a handler-specific fail response
-
resume
protected org.apache.kafka.streams.errors.ProductionExceptionHandler.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.ProductionExceptionHandler.Response>- Parameters:
deadLetterRecords- The list of dead letter records to forward to DLQ- Returns:
- a handler-specific resume response
-