dajac commented on a change in pull request #9103:
URL: https://github.com/apache/kafka/pull/9103#discussion_r465275440



##########
File path: 
clients/src/main/java/org/apache/kafka/common/requests/RequestHeader.java
##########
@@ -37,11 +37,22 @@ public RequestHeader(Struct struct, short headerVersion) {
     }
 
     public RequestHeader(ApiKeys requestApiKey, short requestVersion, String 
clientId, int correlationId) {
-        this(new RequestHeaderData().
-                setRequestApiKey(requestApiKey.id).
-                setRequestApiVersion(requestVersion).
-                setClientId(clientId).
-                setCorrelationId(correlationId),
+        this(requestApiKey, requestVersion, clientId, correlationId, null, 
null);
+    }
+
+    public RequestHeader(ApiKeys requestApiKey,
+                         short requestVersion,
+                         String clientId,
+                         int correlationId,
+                         String initialPrincipalName,
+                         String initialClientId) {

Review comment:
       Actually, we check nulls for these two in `isForwardingRequest` method. 
I don't feel strongly about this but I usually better to use Optional when such 
values are not always present.




----------------------------------------------------------------
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.

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


Reply via email to