dongnuo123 commented on code in PR #18989: URL: https://github.com/apache/kafka/pull/18989#discussion_r1964646708
########## core/src/main/scala/kafka/server/KafkaApis.scala: ########## @@ -2519,19 +2519,28 @@ class KafkaApis(val requestChannel: RequestChannel, def handleConsumerGroupHeartbeat(request: RequestChannel.Request): CompletableFuture[Unit] = { val consumerGroupHeartbeatRequest = request.body[ConsumerGroupHeartbeatRequest] + var future = CompletableFuture.completedFuture[Unit](()) 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)) - CompletableFuture.completedFuture[Unit](()) } else if (!authHelper.authorize(request.context, READ, GROUP, consumerGroupHeartbeatRequest.data.groupId)) { requestHelper.sendMaybeThrottle(request, consumerGroupHeartbeatRequest.getErrorResponse(Errors.GROUP_AUTHORIZATION_FAILED.exception)) - CompletableFuture.completedFuture[Unit](()) + } else if (consumerGroupHeartbeatRequest.data.subscribedTopicNames != null && + !consumerGroupHeartbeatRequest.data.subscribedTopicNames.isEmpty) { Review Comment: Used `isEmpty` instead of `nonEmpty` because the latter only applies to scala collections -- 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