I have a example message structure define as follows 

message A {
        required string cmd = 1;
        optional MessageType1 message_type1 = 2;
        optional MessageType2 message_type2 = 3;
        optional MessageType3 message_typeN = N

message MessageType1 {

    optional dog d = 1;
    optional string msg = 2;

    message dog {
        optional bool isAnimal = 1;

Constructing the message by setting the "cmd" field and "message_type1" 

cmd = "Hello"

message_type1 {
    d {
           isAnimal : false
    msg: "Dog"

The protocol buffer serialization for the above message is proper until the 
bool field value "isAnimal". Post the field name "isAnimal" data is 
corrupted , which means the "msg" field value is not encoded with the 
proper key . What i am observing is , the key value is encodes as zero post 
the "isAnimal" field name . 

Note:  If i set the "isAnimal" field value to true , everything works as 
expected .

Please suggest me to come out of this problem .

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