(Attempt 2 - I'm not sure if messages to this list and moderated or whether 
my first one just got lost in the ether)

Are protobufs serialised canonically?  By that I mean is the same message 
with the same fields populated with the same data guaranteed to serialise 
to the same sequence of bytes, regardless of language/implementation 

The reason I ask is we're using serialised single-field protos as keys in a 
Kafka topic, and I'm now wondering if this is safe.  The idea was to avoid 
ambuiguity about how to interpret the contents of the key.  However, a 
critical requirement of a key is that the same key must serialise to the 
same bytes (Kafka is only aware of bytes - nothing else).

Is what I'm doing safe?  Is it safe for some subset of proto field types 
(for example, I'm already pretty sure it's not safe for map types because 
there is no canonical ordering, right?)?


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to