apoorvmittal10 commented on code in PR #14554: URL: https://github.com/apache/kafka/pull/14554#discussion_r1362658016
########## core/src/test/scala/unit/kafka/server/KafkaApisTest.scala: ########## @@ -6222,4 +6222,62 @@ class KafkaApisTest { assertEquals(expectedResponse, response.data) } + + @Test + def testGetTelemetrySubscriptionsNotAllowedForZkClusters(): Unit = { + val data = new GetTelemetrySubscriptionsRequestData() + data.setClientInstanceId(Uuid.randomUuid()) + + val request = buildRequest(new GetTelemetrySubscriptionsRequest.Builder(data, true).build()) + createKafkaApis(enableForwarding = true).handle(request, RequestLocal.NoCaching) + + val response = verifyNoThrottling[GetTelemetrySubscriptionsResponse](request) + assertEquals(Errors.UNKNOWN_SERVER_ERROR, Errors.forCode(response.data.errorCode)) Review Comment: True but KafkaApis.scala returns IllegalStateException when respective API is not enabled. The reason it returns UNKNOWN_SERVER_ERROR as this path should not be encountered in practice as prior check from ApiVersion response should list which all APIs are enabled. https://github.com/apache/kafka/blob/e7e399b9409b42f82d7ce57b99a461c465e5849d/core/src/main/scala/kafka/server/KafkaApis.scala#L176 -- 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