FrankYang0529 commented on code in PR #17411:
URL: https://github.com/apache/kafka/pull/17411#discussion_r1798735210


##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -3796,7 +3796,15 @@ class KafkaApis(val requestChannel: RequestChannel,
     if (!isConsumerGroupProtocolEnabled()) {
       // The API is not supported by the "old" group coordinator (the 
default). If the
       // new one is not enabled, we fail directly here.
-      requestHelper.sendMaybeThrottle(request, 
consumerGroupHeartbeatRequest.getErrorResponse(Errors.UNSUPPORTED_VERSION.exception))
+      requestHelper.sendMaybeThrottle(request, new 
ConsumerGroupHeartbeatResponse(
+        new ConsumerGroupHeartbeatResponseData()
+          .setErrorCode(Errors.UNSUPPORTED_VERSION.code())
+          .setErrorMessage("An error occurred handling the consumer group 
heartbeat request. " +
+            s"To enable support for the ${Group.GroupType.CONSUMER} group 
protocol, update the broker " +
+            s"configuration for 
\"${GroupCoordinatorConfig.NEW_GROUP_COORDINATOR_ENABLE_CONFIG}\" to \"true\" 
and " +
+            
s"\"${GroupCoordinatorConfig.GROUP_COORDINATOR_REBALANCE_PROTOCOLS_CONFIG}\" to 
" +
+            s"\"${Group.GroupType.CLASSIC}, ${Group.GroupType.CONSUMER}\". 
Alternatively, update the client " +
+            s"configuration for \"group.protocol\" to 
\"${Group.GroupType.CLASSIC}\".")))

Review Comment:
   Hi @dajac and @lianetm, thanks for the suggestion. It's better to write the 
information in consumer side, because old brokers don't have this error 
message. Updated the code.



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