apoorvmittal10 commented on code in PR #15190: URL: https://github.com/apache/kafka/pull/15190#discussion_r1453684188
########## clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslServerAuthenticator.java: ########## @@ -433,7 +437,7 @@ private void handleSaslToken(byte[] clientToken) throws IOException { RequestHeader header = RequestHeader.parse(requestBuffer); ApiKeys apiKey = header.apiKey(); short version = header.apiVersion(); - RequestContext requestContext = new RequestContext(header, connectionId, clientAddress(), + RequestContext requestContext = new RequestContext(header, connectionId, clientAddress(), Optional.of(clientPort()), Review Comment: Hmmm, the reason I kept clientPort Optional in RequestContext is because the data is not required in case of forwarded requests but wherever it can be determined by explicit value then that has been wrapped. I am not of an opinion to make a decision of returning Optional.empty in case connection is closed or socket exception occurred as that scenario ll anyways not make the channel usable. -- 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