Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Public Interfaces

StreamsConfig.java

Changes:

  • Adding the errors.deadletterqueue.topic.name configuration. This configuration is only modifying the behavior of the out of the box exceptions handlers and would have no effect if a custom exception handlers is implemented, for example:
    • if errors.deadletterqueue.topic.name=null (default), then no records are sent to any dead letter queue
    • if errors.deadletterqueue.topic.name is set, exceptions happening during processing, production or deserialization will result in the raw source messages that trigger the topology to be send to the DLQ topic. The processing might or might not continue depending of the configuration of the processing.exception.handler, default.production.exception.handler and default.deserialization.exception.handler configurations
Code Block
languagejava
public static final String ERRORS_DEADLETTERQUEUE_TOPIC_NAME_CONFIG = "errors.deadletterqueue.topic.name";

.define(ERRORS_DEADLETTERQUEUE_TOPIC_NAME_CONFIG, // required with no default value
       Type.STRING,
       null, /* default */
       Importance.HIGH,
       ERRORS_DEADLETTERQUEUE_TOPIC_NAME_DOC)


If the user implement a custom exception handler, it is up to the handler to decide if a record should be send to the DLQ topic, in this case, the errors.deadletterqueue.topic.name  configuration is ignored.

Code Block
languagejava
    @Override
    public ProcessingHandlerResponse handle(final ErrorHandlerContext context, final Record<?, ?> record, final Exception exception) {
        return ProcessingHandlerResponse.CONTINUE
                .withDeadLetterQueueRecords(Collections.singletonList(
                        new ProducerRecord<>("app-dlq", "Hello".getBytes(StandardCharsets.UTF_8), "World".getBytes(StandardCharsets.UTF_8))
                ));
    }

ProductionExceptionHandler.java

...