sebastienviale commented on code in PR #17942: URL: https://github.com/apache/kafka/pull/17942#discussion_r2210198331
########## streams/src/main/java/org/apache/kafka/streams/errors/DeserializationExceptionHandler.java: ########## @@ -95,4 +118,137 @@ enum DeserializationHandlerResponse { } } + /** + * Enumeration that describes the response from the exception handler. + */ + enum Result { + /** Continue processing. */ + RESUME(0, "RESUME"), + /** Fail processing. */ + FAIL(1, "FAIL"); + + /** + * An english description for the used option. This is for debugging only and may change. + */ + public final String name; + + /** + * The permanent and immutable id for the used option. This can't change ever. + */ + public final int id; + + Result(final int id, final String name) { + this.id = id; + this.name = name; + } + + /** + * Converts the deprecated enum DeserializationHandlerResponse into the new Result enum. + * + * @param value the old DeserializationHandlerResponse enum value + * @return a {@link Result} enum value + * @throws IllegalArgumentException if the provided value does not map to a valid {@link Result} + */ + private static DeserializationExceptionHandler.Result from(final DeserializationHandlerResponse value) { + switch (value) { + case FAIL: + return Result.FAIL; + case CONTINUE: + return Result.RESUME; + default: + throw new IllegalArgumentException("No Result enum found for old value: " + value); + } + } + } + + /** + * Represents the result of handling a deserialization exception. + * <p> + * The {@code Response} class encapsulates a {@link Result}, + * indicating whether processing should continue or fail, along with an optional list of + * {@link ProducerRecord} instances to be sent to a dead letter queue. + * </p> + */ + class Response { + + private Result result; + + private List<ProducerRecord<byte[], byte[]>> deadLetterQueueRecords; + + /** + * Constructs a new {@code DeserializationExceptionResponse} object. + * + * @param result the result indicating whether processing should continue or fail; + * must not be {@code null}. + * @param deadLetterQueueRecords the list of records to be sent to the dead letter queue; may be {@code null}. Review Comment: fixed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org