I'm using gRPC to send messages from Java to a Python service. Recently I 
started getting larger messages that sometimes exceed the maximum message 
size for gRPC. Increasing that size is not possible for me due to lack of 
resources and timeouts, so I had to implement a chunking mechanism in order 
to split the large messages.

In Java, I check the message size using getSerializedSize() and if it 
exceeds the maximum size, I do the chunking. However, I noticed that the 
value I'm getting from getSerializedSize() is different and much smaller 
than the one shown in the error "gRPC message exceeds maximum size" which 
means that I still send messages that exhaust the resources.

For example, how is it possible that getSerializedSize() returns 75274 and 
the error shows a size of 179651? Both are supposed to show the size in 
bytes. I also tried getting the size using the length of the byte array, 
but it is identical to getSerializedSize().

How can I know the actual size gRPC will get before sending the message so 
I can apply the chunking when I should?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/602108bd-15fd-421a-96ad-4f7c52bf4a2en%40googlegroups.com.

Reply via email to