dajac commented on code in PR #17989:
URL: https://github.com/apache/kafka/pull/17989#discussion_r1866509662


##########
clients/src/test/java/org/apache/kafka/clients/consumer/internals/ConsumerHeartbeatRequestManagerTest.java:
##########
@@ -602,6 +602,44 @@ public void testHeartbeatResponseOnErrorHandling(final 
Errors error, final boole
         }
     }
 
+    @Test
+    public void testUnsupportedVersion() {
+        mockErrorResponse(Errors.UNSUPPORTED_VERSION, 
Errors.UNSUPPORTED_VERSION.message());
+        ArgumentCaptor<ErrorEvent> errorEventArgumentCaptor = 
ArgumentCaptor.forClass(ErrorEvent.class);
+        verify(backgroundEventHandler).add(errorEventArgumentCaptor.capture());
+        ErrorEvent errorEvent = errorEventArgumentCaptor.getValue();
+
+        // UnsupportedApiVersion in HB response without any custom message. 
It's considered as new protocol not supported.
+        String hbNotSupportedMsg = "The cluster does not support the new 
consumer group protocol. Set group" +
+            ".protocol=classic on the consumer configs to revert to the 
classic protocol until the cluster is upgraded.";
+        assertInstanceOf(Errors.UNSUPPORTED_VERSION.exception().getClass(), 
errorEvent.error());
+        assertEquals(hbNotSupportedMsg, errorEvent.error().getMessage());
+        clearInvocations(backgroundEventHandler);
+
+        // UnsupportedApiVersion in HB response with custom message. Specific 
to required version not present, should
+        // keep the custom message.
+        String hbVersionNotSupportedMsg = "The cluster does not support 
resolution of SubscriptionPattern on version 0. " +

Review Comment:
   I am sorry but I don’t understand what you mean. On the server, we basically 
handle the field if it is provided.



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

Reply via email to