Thank you. I had the same conversation here
https://groups.google.com/forum/#!topic/protobuf/JwiAkWbEAYI and I came to conclusion that Any is for messages with type and it is not good for java serialization I tried it and I got this error. Type of the Any message does not match the given class. Another problem is, since I don't know how to convert bytes (ByteString proto in Java) in message to Java Object I had to manually parse the protos in my application code here. https://github.com/omidp/grpc-crud/blob/master/grpc-server/src/main/java/com/omid/grpc/service/PersonServiceImpl.java#L68 what is the correct way of doing this ? On Wednesday, October 3, 2018 at 3:27:26 AM UTC+3:30, Benjamin Krämer wrote: > > It looks like you wanted to keep the Pagination message independant of > your Person message in > https://github.com/omidp/grpc-crud/blob/master/grpc-proto/src/main/proto/main.proto > > Instead of doing it through bytes, you should prefer the Any type > (google.protobuf.Any) which you already import but not use. This will allow > you to unpack it as the correct type (PersonFilter) and is internally still > stored as bytes. This also works across all languages which makes porting > easier. It's never a good idea to do the (de-)serialization manually. > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/76bbb0ed-0534-403a-9cb6-3b3d4c786b0d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.