Python: Can max receive message length be changed?

84 views
Skip to first unread message

Bu Sun Kim

unread,
Oct 14, 2020, 8:10:26 PM10/14/20
to grpc.io
grpc-java appears to have a `maxInboundMessageSize` https://grpc.github.io/grpc-java/javadoc/io/grpc/ManagedChannelBuilder.html#maxInboundMessageSize-int- that allows the max inbound message size to be changed.

Is there a similar option for Python?


Context:
Some requests to the Cloud Text-to-Speech API result in responses that exceed the 4MB default: https://github.com/googleapis/python-texttospeech/issues/5
Googlers see internal issue 170125537

Lidi Zheng

unread,
Oct 14, 2020, 8:35:06 PM10/14/20
to grpc.io
Yes. You can set the inbound (receiving) message size via a channel argument "grpc.max_receive_message_length" (see definition)


The unit for "grpc.max_receive_message_length" is bytes. If the target limit is 1G, the application can set `("grpc.max_receive_message_length", 1024*1024*1024)` as one of the channel argument.
Reply all
Reply to author
Forward
0 new messages