-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix protobuf wire encoding/decoding #258
base: master
Are you sure you want to change the base?
Fix protobuf wire encoding/decoding #258
Conversation
Bumping this -- curious who all might make sense to ping aside from @Nevon, maybe @odselsevier ? |
I am also very interested in getting this merged in. I read through the code and all looks good to me. I think the only think I would change is the comments could be JSDoc style so you get LSP hints: /**
* like this
*/
// instead of
// this |
Hello, when are you going to merge pr? |
Any news? Is this repo maintained anymore? This PR is crucial to my usecase, as currently I can’t basically send protobuf anywhere using Kafka over Confluent since the encoding is proprietary and, it seems, not implemented in a way that ensure across compatibility across nodejs and other clients |
You can encode message using protobufjs if you have .proto file. That’s works in my case. Only data i need from registry is schema id. Just set it in the message header. |
Hi, and thank you for your tip! Could you please give me a brief example, if possible, of what you mean by “message header”? Are we talking about the headers of the message emitted by the producers, or headers attached to the protobuf encoding? Because I’ve never head of the second, and have no idea of how to name the header field in the first example. |
I am talking about header when you produce message. If u need only consume you dont need that. Any way in case you are able download .proto file to your repository it could help you. try protobufjs library (just google it)
|
@mkoiev Hello Am I right? |
@ktatarchukkt Hello, |
Fixes #152
Specifically, this updates the Protobuf schema registry implementation to match Confluent's wire format spec. In the current release this library can only be used when it is both the serializer and deserializer of Protobuf messages -- this branch brings the Protobuf implementation into alignment with the spec so it can be used with other schema registry clients. The primary update is that message indexes are properly encoded and decoded so the correct message type can be specified from the Protobuf schema's namespace.
I adapted much of this from the Confluent's implementation in Go, along with the variable integer encoding from Go's internal libraries.
This is currently working for several local test cases. We'll continue ensuring this works for us and I'll update this branch accordingly, any additional help with (or recommendations for) testing/implementation would be greatly appreciated.
This PR is dependent on a few updates in protobuf.js that I made here to ensure we have the correct message ordering for extracting indexes: protobufjs/protobuf.js#1957
cc @Nevon