Skip to content

Remove io.confluent:kafka-avro-serializer dependency from kafka-connect#49204

Open
xinlian12 wants to merge 1 commit into
Azure:mainfrom
xinlian12:remove-confluent-dependency
Open

Remove io.confluent:kafka-avro-serializer dependency from kafka-connect#49204
xinlian12 wants to merge 1 commit into
Azure:mainfrom
xinlian12:remove-confluent-dependency

Conversation

@xinlian12
Copy link
Copy Markdown
Member

Summary

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.

Motivation

The io.confluent:kafka-avro-serializer dependency 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

  • New: TestAvroSerializer.java — lightweight test-only serializer (~150 lines) that implements Serializer<GenericRecord> and talks to the Schema Registry REST API to register schemas and produce the Confluent wire format
  • Modified: CosmosSinkConnectorITest.java — replaced KafkaAvroSerializer with TestAvroSerializer in 3 Avro integration tests
  • Modified: pom.xml — removed Confluent Maven repository, kafka-avro-serializer dependency, and shade exclude for io.confluent:*
  • Modified: external_dependencies.txt — removed cosmos_io.confluent:kafka-avro-serializer;7.6.0

Verification

  • Build compiles successfully (mvn compile test-compile -DskipTests)
  • No production code changes — all changes are test-scoped
  • The Confluent Docker images (cp-kafka, cp-schema-registry, cp-kafka-connect) used by testcontainers are unchanged

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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TestAvroSerializer implementing Serializer<GenericRecord> with manual schema registration and Confluent magic-byte framing.
  • Swap KafkaAvroSerializer for TestAvroSerializer in the three Avro integration tests in CosmosSinkConnectorITest.
  • Drop the Confluent Maven repo, the kafka-avro-serializer dependency, the shade exclude for io.confluent:*, and its entry in external_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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants