-
Notifications
You must be signed in to change notification settings - Fork 1
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
Protobuf (probably avro?) not compatible with Confluent schema registry #347
Comments
Hi, |
Thank you. I am now come back with more knowledge and you are exactly correct. My mistake. I will try and provide good test cases/examples of how one should do it in the next two weeks. |
I played around with it for a bit and my understand now is:
|
You are spot on. The schema registry also seems to choose the first message it sees as the main message for encoding. So, sub-message types should come later. This could greatly simplify encode decode due to it always having index 0. I am not sure if schema registry even allows you specify a different message type other than the first one in the schema to encode/decode with. I am also not sure if there is valid use case where you cannot put the main message schema for encoding first. I am new to protobuf and need to learn more. In any case, I will try and show some samples of how I am trying to use it soon. Thank you so much for responding and helping me. |
When serializing data with protobuf, you can send data just fine to the schema registry. With data encoded from this library. However, when trying to create a stream from that data, kafka schema registry will try to deserialize it, and run into deserialization issue, it is missing the messages index.
Here is an error log I got only after trying to emit the topic into a stream. The main error is "Invalid message indexes":
The message indexes part of the binary is actually not included when serializing. I was hoping that this is an actual issue and this library hopes to addess it.
In kafkajs/confluent-schema-registry, there is a PR trying to do just that kafkajs/confluent-schema-registry#258, but I don't really know that much about the mysterious message indexes part. I am trying to learn more, and wanted to create this issue in the meantime. You can find out more about message indexes here:
https://docs.confluent.io/cloud/current/sr/fundamentals/serdes-develop/index.html#wire-format
I think it is funny that their table is very misleading and omits the message-indexes part.
I also think it is funny that I am for some reason allowed to write messages into a topic using a schema id, but I do not get errors. It is not until I try and deserialize the messages I start to get errors...
The text was updated successfully, but these errors were encountered: