Skip to content

KAFKA-19408 : Add check for compression type mismatch for push telemetry requests #19970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,16 @@ private void validatePushRequest(PushTelemetryRequest request, ClientMetricsInst
request.data().clientInstanceId(), clientTelemetryMaxBytes);
throw new TelemetryTooLargeException(msg);
}

// Client library picks the first compression type from the list of supported compression types send by the broker.
// If compression type send in push telemetry request is different from the preferred compression type by broker,
// it means that client has ignored the preferred compression type.
// This is not an error, so log a warning and continue with the push telemetry request.
if (request.data().compressionType() != SUPPORTED_COMPRESSION_TYPES.get(0)) {
String msg = String.format("Compression type [%s] is received in push telemetry is different from the preferred compression type [%s] for client instance id: [%s]. Continuing with the push telemetry request.",
CompressionType.forId(request.data().compressionType()), CompressionType.forId(SUPPORTED_COMPRESSION_TYPES.get(0)), request.data().clientInstanceId());
log.info(msg);
}
}

private static boolean isSupportedCompressionType(int id) {
Expand Down