diff --git a/docs/modules/ROOT/pages/kafka/kafka-streams-binder/error-handling.adoc b/docs/modules/ROOT/pages/kafka/kafka-streams-binder/error-handling.adoc index d425e6f2f..3fe5bb389 100644 --- a/docs/modules/ROOT/pages/kafka/kafka-streams-binder/error-handling.adoc +++ b/docs/modules/ROOT/pages/kafka/kafka-streams-binder/error-handling.adoc @@ -137,7 +137,7 @@ However, you still can configure production exception handlers using the `Stream When it comes to handling errors from application code, i.e. from the business logic execution, it is usually up to the application to handle that. Because, the Kafka Streams binder does not have a way to interfere with the application code. -However, to make things a bit easier for the application, the binder provides a convenient `DltAwareProcessor`, using which, you can dictate how you want to handle the application level errors. +However, to make things a bit easier for the application, the binder provides a convenient `RecordRecoverableProcessor`, using which, you can dictate how you want to handle the application level errors. Consider the following code. @@ -150,8 +150,10 @@ public java.util.function.Function, KStream, KStream, KStream> process() { return input -> input - .process(() -> new DltAwareProcessor<>(record -> { + .process(() -> new RecordRecoverableProcessor<>(record -> { throw new RuntimeException("error"); }, (record, exception) -> { - // log the message + // Handle the record })); } ``` -In this case, when the record fails, the `DltAwareProcessor`, instead of using its built-in recoverer which publishes to a DLT, uses the user provided recoverer which is a `BiConsumer` that takes the failed record and the exception thrown as arguments. +In this case, when the record fails, the `RecordRecoverableProcessor`, uses the user provided recoverer which is a `BiConsumer` that takes the failed record and the exception thrown as arguments. === Handling Record Keys in DltAwareProcessor