duck
duck

Reputation: 2561

GRPC - Python Not able to send message greater than 4 MB

I am currently using grpc version 1.9.0. The GRPC python client seems like throwing error when msg size is greater than 4MB

Rendezvous of RPC that terminated with (StatusCode.RESOURCE_EXHAUSTED, Received message larger than max 

Does any one know how to handle this ? Specifying below does not work

    channel = grpc.insecure_channel(conn_str, options=[('grpc.max_send_message_length', 1000000 * 1000),
                               ('grpc.max_receive_message_length', 1000000 * 1000)])

Have tried to google a lot but in vain

Upvotes: 0

Views: 1369

Answers (1)

Enrico La Sala
Enrico La Sala

Reputation: 86

I solved it by using GRPC Python Cython layer: https://github.com/grpc/grpc/tree/master/src/python/grpcio/grpc/_cython

For example if you want 100MB max message_lenght options will be:

options = [(cygrpc.ChannelArgKey.max_send_message_length, 100 * 1024 * 1024),
           (cygrpc.ChannelArgKey.max_receive_message_length, 100 * 1024 * 1024)]

Upvotes: 1

Related Questions