Class ProductionExceptionHandler.Response
java.lang.Object
org.apache.kafka.streams.errors.ProductionExceptionHandler.Response
- Enclosing interface:
ProductionExceptionHandler
Represents the result of handling a production exception.
The Response class encapsulates a ProductionExceptionHandler.Result,
indicating whether processing should continue or fail, along with an optional list of
ProducerRecord instances to be sent to a dead letter queue.
-
Method Summary
Modifier and TypeMethodDescriptionList<ProducerRecord<byte[], byte[]>> Retrieves an unmodifiable list of records to be sent to the dead letter queue.fail()Creates aResponseindicating that processing should fail.fail(List<ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should fail.result()Retrieves the production exception handler result.resume()Creates aResponseindicating that processing should continue.resume(List<ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should continue.retry()Creates aResponseindicating that processing should retry.
-
Method Details
-
fail
public static ProductionExceptionHandler.Response fail(List<ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should fail.- Parameters:
deadLetterQueueRecords- the list of records to be sent to the dead letter queue; may benull.- Returns:
- a
Responsewith aProductionExceptionHandler.Result.FAILstatus.
-
fail
Creates aResponseindicating that processing should fail.- Returns:
- a
Responsewith aProductionExceptionHandler.Result.FAILstatus.
-
resume
public static ProductionExceptionHandler.Response resume(List<ProducerRecord<byte[], byte[]>> deadLetterQueueRecords) Creates aResponseindicating that processing should continue.- Parameters:
deadLetterQueueRecords- the list of records to be sent to the dead letter queue; may benull.- Returns:
- a
Responsewith aProductionExceptionHandler.Result.RESUMEstatus.
-
resume
Creates aResponseindicating that processing should continue.- Returns:
- a
Responsewith aProductionExceptionHandler.Result.RESUMEstatus.
-
retry
Creates aResponseindicating that processing should retry.- Returns:
- a
Responsewith aProductionExceptionHandler.Result.RETRYstatus.
-
result
Retrieves the production exception handler result.- Returns:
- the
ProductionExceptionHandler.Resultindicating whether processing should continue, fail or retry.
-
deadLetterQueueRecords
Retrieves an unmodifiable list of records to be sent to the dead letter queue.If the list is
null, an empty list is returned.- Returns:
- an unmodifiable list of
ProducerRecordinstances for the dead letter queue, or an empty list if no records are available.
-