You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "jsancio (via GitHub)" <gi...@apache.org> on 2023/02/06 18:43:23 UTC

[GitHub] [kafka] jsancio commented on a diff in pull request #13197: Minor: Decode the envelope requests for the request log

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-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org