Class RecoveringDeserializationExceptionHandler
java.lang.Object
org.springframework.kafka.streams.AbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response>
org.springframework.kafka.streams.RecoveringDeserializationExceptionHandler
- All Implemented Interfaces:
org.apache.kafka.common.Configurable, org.apache.kafka.streams.errors.DeserializationExceptionHandler
public class RecoveringDeserializationExceptionHandler
extends AbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response>
implements org.apache.kafka.streams.errors.DeserializationExceptionHandler
A
DeserializationExceptionHandler that calls a ConsumerRecordRecoverer
or uses the native Kafka Streams DLQ and continues.- Since:
- 2.3
- Author:
- Gary Russell, Soby Chacko
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kafka.streams.errors.DeserializationExceptionHandler
org.apache.kafka.streams.errors.DeserializationExceptionHandler.DeserializationHandlerResponse, org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response, org.apache.kafka.streams.errors.DeserializationExceptionHandler.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name for configuring the native DLQ destination resolver.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringProperty name for configuring the recoverer using properties.Fields inherited from class AbstractRecoveringExceptionHandler
deadLetterRecordManager, deadLetterTopic, destinationResolver, recoverer -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected org.apache.kafka.streams.errors.DeserializationExceptionHandler.Responsefail()Create a response indicating that processing should fail.org.apache.kafka.streams.errors.DeserializationExceptionHandler.DeserializationHandlerResponsehandle(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Deprecated, for removal: This API element is subject to removal in a future version.since 4.1 in favor ofhandleError(ErrorHandlerContext, ConsumerRecord, Exception).org.apache.kafka.streams.errors.DeserializationExceptionHandler.ResponsehandleError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) protected org.apache.kafka.streams.errors.DeserializationExceptionHandler.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.DeserializationExceptionHandler
handle
-
Field Details
-
KSTREAM_DESERIALIZATION_RECOVERER
@Deprecated(since="4.1", forRemoval=true) public static final String KSTREAM_DESERIALIZATION_RECOVERERDeprecated, for removal: This API element is subject to removal in a future version.Since 4.1 in favor ofRECOVERER.Property name for configuring the recoverer using properties.- See Also:
-
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
-
RecoveringDeserializationExceptionHandler
public RecoveringDeserializationExceptionHandler() -
RecoveringDeserializationExceptionHandler
-
-
Method Details
-
handle
@Deprecated(since="4.1", forRemoval=true) public org.apache.kafka.streams.errors.DeserializationExceptionHandler.DeserializationHandlerResponse handle(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Deprecated, for removal: This API element is subject to removal in a future version.since 4.1 in favor ofhandleError(ErrorHandlerContext, ConsumerRecord, Exception).Handle the deserialization exception by delegating to the configured recoverer.- Specified by:
handlein interfaceorg.apache.kafka.streams.errors.DeserializationExceptionHandler
-
handleError
public org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response handleError(org.apache.kafka.streams.errors.ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) - Specified by:
handleErrorin interfaceorg.apache.kafka.streams.errors.DeserializationExceptionHandler
-
configure
-
fail
protected org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response fail()Create a response indicating that processing should fail.- Specified by:
failin classAbstractRecoveringExceptionHandler<org.apache.kafka.streams.errors.DeserializationExceptionHandler.Response>- Returns:
- a handler-specific fail response
-
resume
protected org.apache.kafka.streams.errors.DeserializationExceptionHandler.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.DeserializationExceptionHandler.Response>- Parameters:
deadLetterRecords- The list of dead letter records to forward to DLQ- Returns:
- a handler-specific resume response
-
RECOVERER.