Package org.apache.kafka.streams.errors
Class LogAndContinueExceptionHandler
java.lang.Object
org.apache.kafka.streams.errors.LogAndContinueExceptionHandler
- All Implemented Interfaces:
org.apache.kafka.common.Configurable,DeserializationExceptionHandler
public class LogAndContinueExceptionHandlerextends Object implements DeserializationExceptionHandler
Deserialization handler that logs a deserialization exception and then signals the processing pipeline to continue processing more records.
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kafka.streams.errors.DeserializationExceptionHandler
DeserializationExceptionHandler.DeserializationHandlerResponseConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidhandle(ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Inspect a record and the exception received.handle(ProcessorContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Deprecated.Since 3.9.
Constructor Details
LogAndContinueExceptionHandler
public LogAndContinueExceptionHandler()
Method Details
handle
@Deprecatedpublic DeserializationExceptionHandler.DeserializationHandlerResponse handle(ProcessorContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Deprecated.Since 3.9. Usehandle(ErrorHandlerContext, ConsumerRecord, Exception)instead.Description copied from interface:DeserializationExceptionHandlerInspect a record and the exception received.Note, that the passed in
ProcessorContextonly allows to access metadata like the task ID. However, it cannot be used to emit records viaProcessorContext.forward(Object, Object); callingforward()(and some other methods) would result in a runtime exception.- Specified by:
handlein interfaceDeserializationExceptionHandler- Parameters:
context- Processor context.record- Record that failed deserialization.exception- The actual exception.- Returns:
- Whether to continue or stop processing.
handle
public DeserializationExceptionHandler.DeserializationHandlerResponse handle(ErrorHandlerContext context, org.apache.kafka.clients.consumer.ConsumerRecord<byte[], byte[]> record, Exception exception) Description copied from interface:DeserializationExceptionHandlerInspect a record and the exception received.- Specified by:
handlein interfaceDeserializationExceptionHandler- Parameters:
context- Error handler context.record- Record that failed deserialization.exception- The actual exception.- Returns:
- Whether to continue or stop processing.
configure
- Specified by:
configurein interfaceorg.apache.kafka.common.Configurable