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<org.apache.kafka.clients.producer.ProducerRecord<byte[], byte[]>> Retrieves an unmodifiable list of records to be sent to the dead letter queue.fail()Creates aResponseindicating that processing should fail.Creates aResponseindicating that processing should fail.result()Retrieves the production exception handler result.resume()Creates aResponseindicating that processing should continue.resume(List<org.apache.kafka.clients.producer.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<org.apache.kafka.clients.producer.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<org.apache.kafka.clients.producer.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
public List<org.apache.kafka.clients.producer.ProducerRecord<byte[],byte[]>> 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.
-