gRPC and C#: receive message bigger than maximum allowed

Viewed 22

I am doing some test to request some data to a remote database from a client. For that, I have a client gRPC that call a method in the gRPC, this gRPC server use EF to get the data and send the result to the client.

Well, in my case, I get about 3MB of data, that is higher than the default maximum size allowed for the channel.

I know that I can resolve the problem when I create the channel in the client, in this way, for example, to 60 mb:

var channel = GrpcChannel.ForAddress("http://localhost:5223", 
        new GrpcChannelOptions 
        { 
            MaxReceiveMessageSize = 62914560,
            MaxSendMessageSize = 62914560,
        });

But although I can increase this when I create the channel, I can't ensure that some query returns more data than the maximum allowed.

So I would like to know how I can handle this.

In this case, the method is unaray, it is not a stream.

Thanks.

0 Answers
Related