Kafka Streams (4.2) added native DLQ support via KIP-1034. All three exception handlers (DeserializationExceptionHandler, ProcessingExceptionHandler, ProductionExceptionHandler) gained a handleError() method that returns a Response containing a result (RESUME/FAIL) and an optional list of DLQ ProducerRecords. The DLQ topic is configured via errors.dead.letter.queue.topic.name.
Spring Kafka's RecoveringDeserializationExceptionHandler already implements handleError() but bypasses the native DLQ — it returns Response.resume() with no DLQ records and instead routes failures through DeadLetterPublishingRecoverer + KafkaTemplate.
Changes needed:
- Expose the native DLQ topic configuration on
StreamsBuilderFactoryBean
- Consider providing Spring-friendly equivalents of
RecoveringDeserializationExceptionHandler for the processing and production exception handler types
Kafka Streams (4.2) added native DLQ support via KIP-1034. All three exception handlers (
DeserializationExceptionHandler,ProcessingExceptionHandler,ProductionExceptionHandler) gained ahandleError()method that returns aResponsecontaining a result (RESUME/FAIL) and an optional list of DLQProducerRecords. The DLQ topic is configured viaerrors.dead.letter.queue.topic.name.Spring Kafka's
RecoveringDeserializationExceptionHandleralready implementshandleError()but bypasses the native DLQ — it returnsResponse.resume()with no DLQ records and instead routes failures throughDeadLetterPublishingRecoverer+KafkaTemplate.Changes needed:
StreamsBuilderFactoryBeanRecoveringDeserializationExceptionHandlerfor the processing and production exception handler types