Skip to content

Add reachability metadata for io.confluent:kafka-schema-serializer:8.3.0 - #8714

Open
mvanhorn wants to merge 2 commits into
oracle:masterfrom
mvanhorn:feat/8564-confluent-kafka-schema-serializer
Open

Add reachability metadata for io.confluent:kafka-schema-serializer:8.3.0#8714
mvanhorn wants to merge 2 commits into
oracle:masterfrom
mvanhorn:feat/8564-confluent-kafka-schema-serializer

Conversation

@mvanhorn

Copy link
Copy Markdown

What does this PR do?

This adds GraalVM reachability metadata for io.confluent:kafka-schema-serializer:8.3.0, resolving the new-library request in #8564. Today, native-image builds that integrate Kafka clients with Confluent Schema Registry fail unless the user hand-maintains reflection config, because the serializer infrastructure loads its configuration, its subject- and context-name strategies, and its schema-id serdes reflectively at runtime. Shipping the metadata here means those applications build natively out of the box.

The reporter (jessecoddington) already runs this exact reflection configuration in production and posted it on the issue, so it serves as the verified basis for the entries rather than a guess. The metadata stays deliberately narrow: it registers only the classes that are reflectively reached and exercised by the test, and it uses conditional configuration (condition.typeReached) so it does not bloat images. Concretely, it covers the abstract serde and config base classes, the subject-name strategies (topic, topic-record, record, and the reference strategies), the null context-name strategy, and the schema-id serializers and deserializers.

The contribution mirrors the existing metadata/org.apache.kafka/kafka-clients layout: a per-artifact index, the versioned reachability metadata, a registration entry in the framework list (re-sorted by artifact per the contributing guide), and a Gradle test harness under tests/src. Following the maintainer (kimeta) human-intervention note on the issue, the harness talks to an in-memory mock:// Schema Registry instead of a live Kafka or Schema Registry service, so it needs no external infrastructure.

On testing: every new and changed JSON file parses and validates against the repository's own schemas (the library index, reachability metadata, and framework-list schemas). The harness test does an Avro serialize/deserialize round trip through the mock registry, which reaches the abstract serde, the config, and the schema-id serdes; it then serializes once per configured subject-name strategy and reflectively instantiates each subject- and context-name strategy through its public no-arg constructor, which is the same path Confluent uses to load them from config. That makes each metadata entry load-bearing under native image. The repository's library-scoped generation flow that produces stats/ is expected to run in CI to confirm native coverage.

Contribution requires the Oracle CLA; the signing gate is handled downstream.

Code sections where the PR accesses files, network, docker or some external service

The test resolves the library from the Confluent Maven repository (scoped to the io.confluent group) and otherwise talks only to an in-memory mock:// Schema Registry, so there is no live network, Kafka broker, or Docker dependency.

Fixes #8564

Adds a new-library contribution for io.confluent:kafka-schema-serializer:8.3.0:
metadata index and reachability-metadata.json covering the serializer config,
subject/context name strategies, and schema-id serdes, a framework-list entry,
and a Gradle test harness that exercises the serializers through a mock://
Schema Registry (no live Kafka/Schema Registry service required).

Fixes oracle#8564

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QK73cX8EuqqwQEJUbycu6g
@kimeta

kimeta commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Hey @mvanhorn, thanks for the contribution! CI fails in nativeTest: all seven strategyTypesAreReflectivelyInstantiable cases fail. The metadata itself is fine, the problem is that every entry is gated on typeReached: AbstractKafkaSchemaSerDeConfig, and that test never reaches that class, so the registrations stay inactive. Do you want to fix this, or should I do it?

Removed the `typeReached: AbstractKafkaSchemaSerDeConfig` condition from the seven strategy registrations. They are now active for direct reflective instantiation while all unrelated metadata remains unchanged.
### CODEX STATUS
- **PASS:** JSON syntax validation with `jq`
- **PASS:** `git diff --check`
- **PASS:** Diff scope: one metadata file, 21 deletions
- **ENV_BLOCKED:** Gradle validation, lint, and focused tests. The Gradle 9.1 wrapper distribution is not cached and network access cannot resolve `services.gradle.org`. The installed OpenJDK 21 also lacks `native-image`.
- **NOTES:** No rebase or upstream-tree materialization attempted.
Codex session ID: 019ffb91-e9a6-7211-81e4-1a3f03d3521f
@mvanhorn

Copy link
Copy Markdown
Author

Thanks for the precise diagnosis, that was exactly it. Removed the typeReached: AbstractKafkaSchemaSerDeConfig condition from all seven strategy registrations so they are active for direct reflective instantiation. Everything else in the metadata is untouched.

One file, 21 deletions, JSON validated. I could not run the Gradle validation or nativeTest locally since the Gradle 9.1 wrapper is not cached here and my JDK lacks native-image, so CI will be the real confirmation that the seven strategyTypesAreReflectivelyInstantiable cases now pass.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for io.confluent:kafka-schema-serializer:8.3.0

2 participants