apoorvmittal10 commented on code in PR #15148:
URL: https://github.com/apache/kafka/pull/15148#discussion_r1446625255


##########
clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryUtils.java:
##########
@@ -175,16 +182,40 @@ public static boolean 
validateRequiredResourceLabels(Map<String, String> metadat
     }
 
     public static CompressionType 
preferredCompressionType(List<CompressionType> acceptedCompressionTypes) {
-        // TODO: Support compression in client telemetry.
+        if (acceptedCompressionTypes != null && 
!acceptedCompressionTypes.isEmpty()) {
+            // Broker is providing the compression types in order of 
preference. Grab the
+            // first one.
+            return acceptedCompressionTypes.get(0);

Review Comment:
   Thanks for looking at PR Philip. Never for Java client as we support all 
compression types in java client. Below is what KIP says
   
   `
   The broker will return a prioritized list of supported compression types in 
the GetTelemetrySubscriptionsResponse.AcceptedCompressionTypes array, the 
client is free to pick any supported compression type but should pick the first 
mutually supported type in the returned list. If the AcceptedCompressionTypes 
array is empty the client must send metrics uncompressed. The default 
compression types list as returned from the broker should be: ZStd, LZ4, GZip, 
Snappy.`



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