Support protobuf native schema#486
Open
shibd wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for Pulsar Protobuf Native schema in the Node client by exposing helper utilities to generate the required schema info from protobufjs descriptor output, updating the native binding schema plumbing, and adding an end-to-end test validating produce/consume behavior.
Changes:
- Add
ProtobufNativeSchemahelper module (root creation from reflection JSON + schema info generation usingFileDescriptorSet). - Extend schema type handling in the native binding to support
ProtobufNative. - Add an end-to-end Jest test (with generated protobuf artifacts) and include
protobufjsas a dependency.
Reviewed changes
Copilot reviewed 7 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/SchemaInfo.h |
Switch schema representation to Pulsar C++ SchemaType + std::map properties. |
src/SchemaInfo.cc |
Add ProtobufNative mapping and set schema on producer/consumer configs via C++ API. |
src/ProtobufNativeSchema.js |
New helper utilities to build Protobuf Native schema info from protobufjs. |
index.js |
Export ProtobufNativeSchema from the main module. |
index.d.ts |
Add ProtobufNativeSchema typings and extend SchemaType union. |
package.json |
Add protobufjs dependency. |
yarn.lock / package-lock.json |
Lockfile updates for protobufjs (and transitive deps). |
.eslintignore |
Ignore generated protobuf artifacts under tests. |
tests/protobuf_native_schema.test.js |
New end-to-end test for Protobuf Native schema produce/consume. |
tests/protobuf_schema/generated/* |
Generated protobuf JS/TS artifacts + reflection JSON used by the test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
BewareMyPower
left a comment
There was a problem hiding this comment.
Could you verify if it can work with Java client? You can fork https://github.com/BewareMyPower/pulsar-protobuf-native-demo to test the latest implementation.
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.
Fixes #
Master Issue: #
Motivation
Support protobuf native schema
Modifications
Verifying this change
Documentation
doc-required(Your PR needs to update docs and you will update later)
doc-not-needed(Please explain why)
doc(Your PR contains doc changes)
doc-complete(Docs have been already added)