Repository navigation
Conversation
Bumps org.apache.kafka:kafka-clients from 4.3.1 to 4.4.0. --- updated-dependencies: - dependency-name: org.apache.kafka:kafka-clients dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
… kafka-clients 4.4.0 kafka-clients 4.4.0 moved org.apache.kafka.common.utils.ByteUtils to the internal package org.apache.kafka.common.utils.internals (KAFKA-20297, apache/kafka#21856). Decode Confluent Protobuf message indexes with a local zig-zag varint reader that matches ByteUtils.readVarint(ByteBuffer) exactly, so we no longer depend on Kafka internals.
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
kafka-clients 4.4.0 moved
ByteUtilsinto the internal packageorg.apache.kafka.common.utils.internals(KAFKA-20297, apache/kafka#21856).KafkaProtobufDeserializerimports it, sopowertools-kafkafails to compile in Dependabot PR #2704. This PR supersedes #2704.Changes
org.apache.kafka:kafka-clientsfrom 4.3.1 to 4.4.0 inpowertools-kafkaand the Kafka example (Dependabot commit from chore: bump org.apache.kafka:kafka-clients from 4.3.1 to 4.4.0 #2704).ByteUtils.readVarintwith a local package-privatereadVarint(ByteBuffer)inKafkaProtobufDeserializer. It decodes an unsigned varint of at most 5 bytes and applies zigzag decoding. It returns the same values as Kafka's previous implementation, throwsIllegalArgumentExceptionafter 5 bytes and throwsBufferUnderflowExceptionon truncated input. We did not use protobuf'sCodedInputStream.readSInt32()because it accepts up to 10 bytes.CodedOutputStream.writeSInt32NoTaginstead ofByteUtils. 3 new tests cover boundary values,Integer.MIN_VALUEandInteger.MAX_VALUE, an over-long varint and a truncated varint.mvn -pl powertools-kafka -am clean verifypasses on Java 21: 95 kafka tests, 0 failures.No customer-facing behavior change.
Follow-up:
examples/powertools-examples-kafka/tools/.../GenerateProtobufSamples.javastill importsByteUtils. It pins kafka-clients 4.0.2, so it is not affected by this PR, but it will break on 4.4.0 or later.Issue number: closes #2710
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.