chia7712 commented on code in PR #17731:
URL: https://github.com/apache/kafka/pull/17731#discussion_r1864486483
##########
core/src/main/scala/kafka/network/SocketServer.scala:
##########
@@ -1133,23 +1133,27 @@ private[kafka] class Processor(
expiredConnectionsKilledCount.record(null, 1, 0)
} else {
val connectionId = receive.source
- val context = new RequestContext(header, connectionId,
channel.socketAddress, Optional.of(channel.socketPort()),
- channel.principal, listenerName, securityProtocol,
channel.channelMetadataRegistry.clientInformation,
- isPrivilegedListener, channel.principalSerde)
-
- val req = new RequestChannel.Request(processor = id, context =
context,
- startTimeNanos = nowNanos, memoryPool, receive.payload,
requestChannel.metrics, None)
-
+ var requestAndSize: Option[RequestAndSize] = None
// KIP-511: ApiVersionsRequest is intercepted here to catch
the client software name
// and version. It is done here to avoid wiring things up to
the api layer.
if (header.apiKey == ApiKeys.API_VERSIONS) {
- val apiVersionsRequest = req.body[ApiVersionsRequest]
+ val result = RequestContext.staticParseRequest(header,
receive.payload, connectionId, listenerName, channel.principal)
+ val apiVersionsRequest =
result.request.asInstanceOf[ApiVersionsRequest]
if (apiVersionsRequest.isValid) {
channel.channelMetadataRegistry.registerClientInformation(new ClientInformation(
apiVersionsRequest.data.clientSoftwareName,
apiVersionsRequest.data.clientSoftwareVersion))
Review Comment:
What I mean is that `context#clientInformation` gets updated when the
request is related to `API_VERSIONS`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]