maxfortun commented on code in PR #16812: URL: https://github.com/apache/kafka/pull/16812#discussion_r1707044581
########## clients/src/main/java/org/apache/kafka/common/requests/ProduceRequest.java: ########## @@ -39,7 +39,42 @@ import static org.apache.kafka.common.requests.ProduceResponse.INVALID_OFFSET; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + public class ProduceRequest extends AbstractRequest { + public static final Logger log = LoggerFactory.getLogger(ProduceRequest.class); + + public static final String PRODUCE_REQUEST_PARSER_PROPERTY = "org.apache.kafka.common.requests.ProduceRequestParser"; + public static final String PRODUCE_REQUEST_PARSER_ENV = "KAFKA_PRODUCE_REQUEST_PARSER"; + public static final String PRODUCE_REQUEST_PARSER_DEFAULT = "org.apache.kafka.common.requests.DefaultProduceRequestParser"; + + private static ProduceRequestParser produceRequestParser = null; + static { + String produceRequestParserClassName = null; + try { + produceRequestParserClassName = System.getProperty(PRODUCE_REQUEST_PARSER_PROPERTY); + + if (null != produceRequestParserClassName) { + log.debug("ProduceRequestParser class {} from system property {}", produceRequestParserClassName, PRODUCE_REQUEST_PARSER_PROPERTY); + } else { + produceRequestParserClassName = System.getenv(PRODUCE_REQUEST_PARSER_ENV); Review Comment: Checking for best way to get KafkaConfig into this component. Thank you. -- 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