Support protobuf native schema#486
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.
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.
Sure, I verified the following case:
After this PR is released, I’ll prepare a repository like the one you mentioned so everyone can validate it more easily. |
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)