Golang Dynamically create Message from .proto files

404 views
Skip to first unread message

Gary Vidal

unread,
Oct 21, 2023, 2:46:45 PM10/21/23
to Protocol Buffers
I have a use case where I need to dynamically read a .proto definition and deserialize a byte array of matching message. I scoured the internet does anyone have a working example. I am writing a kafka plugin that filters messages and uses a schema registry to store and retrieve proto files.  

Something like the following:
DeserializeMessage(proto string, bytes byte[]). 

Must be in go please.

Em Rauch

unread,
Oct 23, 2023, 10:44:02 AM10/23/23
to Protocol Buffers
This exists in Java as DynamicMessage but I believe the equivalent does not exist in the official Go implementation.

You may find an OSS implementation that achieves the same (for example https://github.com/bufbuild/prototransform may do what you need).
Reply all
Reply to author
Forward
0 new messages