jolshan commented on code in PR #12845:
URL: https://github.com/apache/kafka/pull/12845#discussion_r1023258771


##########
clients/src/main/java/org/apache/kafka/common/requests/JoinGroupResponse.java:
##########
@@ -28,9 +28,15 @@ public class JoinGroupResponse extends AbstractResponse {
 
     private final JoinGroupResponseData data;
 
-    public JoinGroupResponse(JoinGroupResponseData data) {
+    public JoinGroupResponse(JoinGroupResponseData data, short version) {
         super(ApiKeys.JOIN_GROUP);
         this.data = data;
+
+        // All versions prior to version 7 do not support nullable
+        // string for the protocol type. Empty string should be used.
+        if (version < 7 && data.protocolType() == null) {

Review Comment:
   Oh I see it used to be done here in KafkaApis:
   ```
           val protocolName = if (request.context.apiVersion() >= 7)
             joinResult.protocolName.orNull
           else
             joinResult.protocolName.getOrElse(GroupCoordinator.NoProtocol)
   ```



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

Reply via email to