-
-
Notifications
You must be signed in to change notification settings - Fork 659
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
Support ANY field in Protobuf descriptors #543
base: dev
Are you sure you want to change the base?
Conversation
6df6117
to
60aba97
Compare
Going to test this out hopefully today, feedback soon. |
Looking at this, the proto serde is not working and i'm not seeing any error messages. This leads me to believe it's a configuration error. Can you confirm this config should be correct:
Note that the descriptor files are not self-containing as it doesn't make sense once you have So basically we have
And then many payload types, each type has its own protobin file. All these protobin files are in the |
Could you, please, provide the whole config file? Maybe you have placed deserialization block in the wrong place? It should be under your Kafka cluster on the same level as its "properties". I will show you my whole config once I'm at the computer.
|
Hi, @jorgheymans !
It should not be a problem that descriptor files are not self-containing. I believe it's just configuration issue since there are no any error messages. Seems like |
Indeed the config block was placed under topics, i have corrected it and as soon as I'm able to test this again i'll let you know, may take a few days with all the holidays going on. |
@jorgheymans : please tell me what you test is going on. |
It won't be before next week, full holiday mode here sorry !
…On Sun, Dec 27, 2020 at 10:15 PM Ludovic DEHON ***@***.***> wrote:
@jorgheymans <https://github.com/jorgheymans> : please tell me what you
test is going on.
I would like to release a new AKHQ version will a full support of protobuf
(v1).
Thanks for your time @xakassi <https://github.com/xakassi> & @jorgheymans
<https://github.com/jorgheymans> !
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#543 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABPKAA6OA3LE54ZWC55EJDSW6PXFANCNFSM4U6IWCVA>
.
|
@jorgheymans : have a good holidays ! |
Hi, @jorgheymans ! |
Hi! |
It's missing the google.protobuf.timestamp descriptor, this is part of the
well known types
https://developers.google.com/protocol-buffers/docs/reference/csharp/class/google/protobuf/well-known-types/timestamp
I guess we should generate a separate descriptor for these internal types
as well ?
…On Mon, Jan 11, 2021 at 1:12 PM Taisiia Goltseva ***@***.***> wrote:
Hi!
Are your descriptor files ok? It's an exception from standard function
FileDescriptorSet.parseFrom(descriptorFile), it cannot parse your
descriptor file.
Could you provide more info about your descriptor files and data? Maybe
some fake data to reproduce.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#543 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABPKAHBJ4SCLXEMTDBZFSTSZLTLPANCNFSM4U6IWCVA>
.
|
60aba97
to
90d63a1
Compare
I have added a unit test for an object with Timestamp field. @jorgheymans , please, see the unit test
And it deserialized successfully. |
f44ea1f
to
b0615a7
Compare
The error surfaces if you have a |
Yes, indeed. But in my case (when I test) I get other error in a different function (not here But anyway my current approach of collecting necessary descriptors is incomplete. And it would be better to just add all custom descriptors from a specified folder and add all well-known-descriptors. The one question is - how to get all well-known-descriptors. @jorgheymans could you, please, tell me how you implemented that? How do you get all well-known-descriptors? It would be easier and faster for me :) |
@jorgheymans
|
@xakassi The .proto files for the well-known-descriptors can be found in the com.google.protobuf:protobuf-java jar under the folder google/protobuf. You can compile these proto definitions and generate a single protobin file. We have a maven pom file to do that. |
Thanks, @geertvb ! I will try this approach! |
b0615a7
to
ea2f01b
Compare
I had some troubles with making single DescriptorSet, and I have implemented it in a different way. I think, it's better in my case. Please, guys, try your use case again with my new fixed code! @jorgheymans |
@xakassi Initially we also hard coded the well defined types like that but it is less flexible. Besides that we needed the protobin files for another project where we can't use that trick because we aren't using the google libraries. |
@geertvb You can put any additional protobin files in |
7abc038
to
430b80a
Compare
740115e
to
661b6e5
Compare
741b9d5
to
190f137
Compare
Hi, @tchiotludo! |
8376a48
to
35cf9ec
Compare
at @dert1714, I don't have a lot of knowledge of protobuf. |
@dert1714 build failed due to incorrect unit that need to be fixed before merging |
670f1e4
to
c757938
Compare
I was able to fix this error by building proto.desc file with argument |
This a fix for a bug described in PR 529.
Any
field is now supported for Protobuf descriptors. Multiple layer complex objects withAny
fields on any layers are also supported using recursion. Please, see unit tests for examples.The principle of operation is as follows. If a message contains a field with type
Any
, we can find out an actual field type at the runtime from the message, get descriptors for this field type and add them to TypeRegistry. To get the descriptors for this field type I pre-built a map with pairs - for all types provided in all descriptors.Hi, @tchiotludo , @jorgheymans ! Please, take a look at this PR.
@jorgheymans I hope your case is fully covered now, please, test on your data.