Remove io.confluent:kafka-avro-serializer dependency from kafka-connect#49204
Open
xinlian12 wants to merge 1 commit into
Open
Remove io.confluent:kafka-avro-serializer dependency from kafka-connect#49204xinlian12 wants to merge 1 commit into
xinlian12 wants to merge 1 commit into
Conversation
Replace the Confluent KafkaAvroSerializer with a lightweight TestAvroSerializer that produces the same Confluent wire format (magic byte + schema ID + Avro binary) using the Schema Registry REST API directly. This eliminates the need for the Confluent Maven repository (packages.confluent.io) — all Maven dependencies now resolve from Maven Central. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the io.confluent:kafka-avro-serializer dependency (and the Confluent Maven repository) from azure-cosmos-kafka-connect by introducing a small test-only TestAvroSerializer that produces the Confluent wire format directly against the Schema Registry REST API. This unblocks builds that cannot resolve from packages.confluent.io and limits dependencies to Maven Central.
Changes:
- Add
TestAvroSerializerimplementingSerializer<GenericRecord>with manual schema registration and Confluent magic-byte framing. - Swap
KafkaAvroSerializerforTestAvroSerializerin the three Avro integration tests inCosmosSinkConnectorITest. - Drop the Confluent Maven repo, the
kafka-avro-serializerdependency, the shade exclude forio.confluent:*, and its entry inexternal_dependencies.txt.
Show a summary per file
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/TestAvroSerializer.java | New lightweight test serializer that registers schemas via REST and emits Confluent wire format. |
| sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorITest.java | Replaces KafkaAvroSerializer references with TestAvroSerializer in 3 Avro tests. |
| sdk/cosmos/azure-cosmos-kafka-connect/pom.xml | Removes Confluent repository, the Avro serializer dependency, and the related shade exclude. |
| eng/versioning/external_dependencies.txt | Removes the cosmos_io.confluent:kafka-avro-serializer version entry. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 0
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
Replace the Confluent
KafkaAvroSerializerwith a lightweightTestAvroSerializerthat produces the same Confluent wire format (magic byte + schema ID + Avro binary) using the Schema Registry REST API directly.Motivation
The
io.confluent:kafka-avro-serializerdependency requires the Confluent Maven repository (packages.confluent.io), which is not Maven Central. This change eliminates that external repository requirement — all Maven dependencies now resolve from Maven Central.Changes
TestAvroSerializer.java— lightweight test-only serializer (~150 lines) that implementsSerializer<GenericRecord>and talks to the Schema Registry REST API to register schemas and produce the Confluent wire formatCosmosSinkConnectorITest.java— replacedKafkaAvroSerializerwithTestAvroSerializerin 3 Avro integration testspom.xml— removed Confluent Maven repository,kafka-avro-serializerdependency, and shade exclude forio.confluent:*external_dependencies.txt— removedcosmos_io.confluent:kafka-avro-serializer;7.6.0Verification
mvn compile test-compile -DskipTests)