Class DefaultProductionExceptionHandler
java.lang.Object
org.apache.kafka.streams.errors.DefaultProductionExceptionHandler
- All Implemented Interfaces:
org.apache.kafka.common.Configurable,ProductionExceptionHandler
ProductionExceptionHandler that always instructs streams to fail when an exception
happens while attempting to produce result records.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.kafka.streams.errors.ProductionExceptionHandler
ProductionExceptionHandler.ProductionExceptionHandlerResponse, ProductionExceptionHandler.Response, ProductionExceptionHandler.Result, ProductionExceptionHandler.SerializationExceptionOrigin -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(ErrorHandlerContext context, org.apache.kafka.clients.producer.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 to continue or stop processing.handleSerializationError(ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord record, Exception exception, ProductionExceptionHandler.SerializationExceptionOrigin origin) Handles serialization exception and determine if the process should continue.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.streams.errors.ProductionExceptionHandler
handle, handle, handleSerializationException, handleSerializationException
-
Constructor Details
-
DefaultProductionExceptionHandler
public DefaultProductionExceptionHandler()
-
-
Method Details
-
handleError
public ProductionExceptionHandler.Response handleError(ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]> record, Exception exception) Description copied from interface:ProductionExceptionHandlerInspect a record that we attempted to produce, and the exception that resulted from attempting to produce it and determine to continue or stop processing.- Specified by:
handleErrorin interfaceProductionExceptionHandler- Parameters:
context- The error handler context metadata.record- The record that failed to produce.exception- The exception that occurred during production.- Returns:
- a
ProductionExceptionHandler.Responseobject
-
handleSerializationError
public ProductionExceptionHandler.Response handleSerializationError(ErrorHandlerContext context, org.apache.kafka.clients.producer.ProducerRecord record, Exception exception, ProductionExceptionHandler.SerializationExceptionOrigin origin) Description copied from interface:ProductionExceptionHandlerHandles serialization exception and determine if the process should continue. The default implementation is to fail the process.- Specified by:
handleSerializationErrorin interfaceProductionExceptionHandler- Parameters:
context- The error handler context metadata.record- The record that failed to serialize.exception- The exception that occurred during serialization.origin- The origin of the serialization exception.- Returns:
- a
ProductionExceptionHandler.Responseobject
-
configure
-