-
Notifications
You must be signed in to change notification settings - Fork 307
Open
Labels
Description
Background
Apicurio Registry currently uses the com.squareup.wire:wire-schema library (version 5.3.3) for Protocol Buffers schema parsing and manipulation. This library is primarily used in:
utils/protobuf-schema-utilitiesmoduleschema-util/protobufmoduleserdes/generic/serde-common-protobufmodule- Various protobuf-related components for validation, canonicalization, compatibility checking, and reference handling
Proposal
Investigate replacing the wire-schema library with Quarkus gRPC Zero, a new experimental feature that provides a pure JVM-based approach to Protocol Buffers compilation.
About gRPC Zero
gRPC Zero is an innovative Quarkus extension that:
- Runs
protoccompilation entirely within the JVM using WebAssembly - Eliminates the need for platform-specific native protoc binaries
- Uses Chicory to translate the protobuf engine to pure Java bytecode
- Provides portable, consistent builds across different environments (laptops, CI, containers, edge devices)
- Simplifies continuous integration and reduces maintenance overhead
More information: https://quarkus.io/blog/grpc-zero/
Goals
This proof of concept should explore:
- Feasibility: Can grpc-zero replace the functionality currently provided by wire-schema?
- API Compatibility: What changes would be required to adapt existing code?
- Performance: How does grpc-zero compare in terms of performance?
- Build Integration: How would grpc-zero integrate with our current Maven build process?
- Dependencies: What dependency changes would be required? Can we reduce the dependency footprint?
Scope
This is a proof of concept task. The goal is to:
- Create a prototype implementation in a branch
- Document findings about compatibility and migration effort
- Identify any gaps or limitations
- Provide recommendations on whether a full migration would be beneficial
Current wire-schema Usage
Key areas where wire-schema is currently used:
FileDescriptorUtils- Converting between wire-schema and protobuf descriptorsProtobufSchemaLoader- Loading and parsing protobuf schemasProtobufFile- Representing protobuf schema filesProtobufContentValidator- Validating protobuf contentProtobufCompatibilityChecker- Checking protobuf schema compatibilityProtobufReferenceFinder- Finding references in protobuf schemasProtobufDereferencer- Dereferencing protobuf schemasProtobufContentCanonicalizer- Canonicalizing protobuf content
Dependencies to Consider
Current protobuf-related dependencies:
com.squareup.wire:wire-schema:5.3.3com.squareup.wire:wire-schema-jvm:5.3.3com.squareup.okio:okio-jvm:3.10.2com.squareup.okio:okio-fakefilesystem:3.10.2com.ibm.icu:icu4j:76.1com.google.protobuf:protobuf-java:4.33.0org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1
Success Criteria
The POC will be considered successful if it demonstrates:
- Basic protobuf schema parsing and manipulation using grpc-zero
- A clear migration path for existing wire-schema usage
- Potential benefits in terms of build portability and simplification
- No significant performance regressions
- Reduction in platform-specific build dependencies
References
- gRPC Zero blog post: https://quarkus.io/blog/grpc-zero/
- Chicory WebAssembly runtime: https://chicory.dev
- Current wire-schema dependency: https://github.com/square/wire