jsancio commented on code in PR #13197: URL: https://github.com/apache/kafka/pull/13197#discussion_r1097782211
########## core/src/main/scala/kafka/network/RequestConvertToJson.scala: ########## @@ -60,7 +61,16 @@ object RequestConvertToJson { case req: ElectLeadersRequest => ElectLeadersRequestDataJsonConverter.write(req.data, request.version) case req: EndTxnRequest => EndTxnRequestDataJsonConverter.write(req.data, request.version) case req: EndQuorumEpochRequest => EndQuorumEpochRequestDataJsonConverter.write(req.data, request.version) - case req: EnvelopeRequest => EnvelopeRequestDataJsonConverter.write(req.data, request.version) + case req: EnvelopeRequest => { + val envelopeRequestData = req.data() + val envelopeData = envelopeRequestData.requestData().duplicate() + val envelopeHeader = EnvelopeUtils.parseForwardedRequestHeader(envelopeData) + val requestJson = RequestConvertToJson.request(AbstractRequest.parseRequest(envelopeHeader.apiKey(), envelopeHeader.apiVersion(), envelopeData).request) Review Comment: Hey @mumrah, does this parse the enveloped request twice? If so, is it possible to implement this feature without parsing the enveloped request twice? -- 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