Package org.apache.kafka.streams.errors
Interface ProductionExceptionHandler
- All Superinterfaces:
Configurable
- All Known Implementing Classes:
DefaultProductionExceptionHandler
Interface that specifies how an exception when attempting to produce a result to
Kafka should be handled.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptionhandle
(ProducerRecord<byte[], byte[]> record, Exception exception) Deprecated.Since 3.9.handle
(ErrorHandlerContext context, ProducerRecord<byte[], byte[]> record, Exception exception) Inspect a record that we attempted to produce, and the exception that resulted from attempting to produce it and determine whether or not to continue processing.handleSerializationException
(ProducerRecord record, Exception exception) Deprecated.Since 3.9.handleSerializationException
(ErrorHandlerContext context, ProducerRecord record, Exception exception, ProductionExceptionHandler.SerializationExceptionOrigin origin) Handles serialization exception and determine if the process should continue.Methods inherited from interface org.apache.kafka.common.Configurable
configure
-
Method Details
-
handle
@Deprecated default ProductionExceptionHandler.ProductionExceptionHandlerResponse handle(ProducerRecord<byte[], byte[]> record, Exception exception) Deprecated.Since 3.9. Usehandle(ErrorHandlerContext, ProducerRecord, Exception)
instead.Inspect a record that we attempted to produce, and the exception that resulted from attempting to produce it and determine whether or not to continue processing.- Parameters:
record
- The record that failed to produceexception
- The exception that occurred during production
-
handle
default ProductionExceptionHandler.ProductionExceptionHandlerResponse handle(ErrorHandlerContext context, ProducerRecord<byte[], byte[]> record, Exception exception) Inspect a record that we attempted to produce, and the exception that resulted from attempting to produce it and determine whether or not to continue processing.- Parameters:
context
- The error handler context metadatarecord
- The record that failed to produceexception
- The exception that occurred during production
-
handleSerializationException
@Deprecated default ProductionExceptionHandler.ProductionExceptionHandlerResponse handleSerializationException(ProducerRecord record, Exception exception) Deprecated.Handles serialization exception and determine if the process should continue. The default implementation is to fail the process.- Parameters:
record
- the record that failed to serializeexception
- the exception that occurred during serialization
-
handleSerializationException
default ProductionExceptionHandler.ProductionExceptionHandlerResponse handleSerializationException(ErrorHandlerContext context, ProducerRecord record, Exception exception, ProductionExceptionHandler.SerializationExceptionOrigin origin) Handles serialization exception and determine if the process should continue. The default implementation is to fail the process.- Parameters:
context
- the error handler context metadatarecord
- the record that failed to serializeexception
- the exception that occurred during serializationorigin
- the origin of the serialization exception
-