Dabz commented on code in PR #17942: URL: https://github.com/apache/kafka/pull/17942#discussion_r1860996923
########## streams/src/main/java/org/apache/kafka/streams/errors/CommonExceptionHandler.java: ########## Review Comment: I renamed this class to ExceptionHandlerUtils, make it packaged protected, and made all methods statics to avoid inheritance. ########## streams/src/main/java/org/apache/kafka/streams/errors/CommonExceptionHandler.java: ########## @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.kafka.streams.errors; + +import org.apache.kafka.clients.producer.ProducerRecord; +import org.apache.kafka.common.Configurable; +import org.apache.kafka.common.errors.InvalidConfigurationException; +import org.apache.kafka.common.serialization.StringSerializer; +import org.apache.kafka.streams.StreamsConfig; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.Collections; +import java.util.Map; + +/** + * {@code CommonExceptionHandler} Contains utilities method that could be used by all exception handlers + */ +public class CommonExceptionHandler implements Configurable { + protected String deadLetterQueueTopicName = null; + public static final String HEADER_ERRORS_EXCEPTION_NAME = "__streams.errors.exception"; + public static final String HEADER_ERRORS_STACKTRACE_NAME = "__streams.errors.stacktrace"; + public static final String HEADER_ERRORS_EXCEPTION_MESSAGE_NAME = "__streams.errors.message"; + public static final String HEADER_ERRORS_TOPIC_NAME = "__streams.errors.topic"; + public static final String HEADER_ERRORS_PARTITION_NAME = "__streams.errors.partition"; + public static final String HEADER_ERRORS_OFFSET_NAME = "__streams.errors.offset"; + + + public boolean shouldBuildDeadLetterQueueRecord() { Review Comment: Changed it to package protected -- 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