Re: Versioning Protobuf files

761 views
Skip to first unread message

users ....

unread,
Jun 13, 2012, 11:39:32 AM6/13/12
to prot...@googlegroups.com
hi,
 
This is actually  a little more complicated than just version.  There are times I actually want to process with an old proto file and ignore new fields added by some new development. This feature is one of the many that made Protobuf attractive to our development needs.  I think a better question would be is there an enhancement feature that could be implmented to verify the proto message was created from a specific proto file.  I'm guessing we could request that the .proto file be hashed and provide the abilitiy to compare the hashes?  Then the user could determine if they want to enforce strict versioning, throw warnings, etc?
 
my $.02
 
-Mike
On Tuesday, June 12, 2012 2:27:28 AM UTC-7, DK wrote:
Hi,

Is there any recommended way to version Protobuf files so that both Client and Server can ensure they are using the same compiled Protobuf classes?

I'm guessing adding a version field to each message is the only option?

Nader Salehi

unread,
Jun 13, 2012, 11:46:55 AM6/13/12
to users ...., prot...@googlegroups.com

You can already do this.  Get the File Descriptor Set of the .proto then create its hash value.  We use the same technique in our dev environment.

--
You received this message because you are subscribed to the Google Groups "Protocol Buffers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/protobuf/-/kU3dU2DEh24J.
To post to this group, send email to prot...@googlegroups.com.
To unsubscribe from this group, send email to protobuf+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/protobuf?hl=en.

users ....

unread,
Jun 14, 2012, 10:26:02 AM6/14/12
to prot...@googlegroups.com
I agree the hash exists,but I was looking for an option to actually put data on the wire.  Similar to the Java implemented WriteDelimeted functions a WriteVersioned, such that the information is prepended.  We can put the information you listed in a message and prepend it ourselves.  This works well in streaming situations for a sync stream type behavior as well (using fixed size fields).
 
Thanks
Reply all
Reply to author
Forward
0 new messages