Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How do I override maxMsgSize? #445

Closed
lingyuan2014 opened this issue Aug 18, 2017 · 1 comment
Closed

How do I override maxMsgSize? #445

lingyuan2014 opened this issue Aug 18, 2017 · 1 comment

Comments

@lingyuan2014
Copy link

One of my request is getting the following error message:

{"error":"grpc: received message larger than max (7696103 vs. 4194304)","code":8}

I was able to override the maxMsgSize on the gprc server side. I believe this is due to grpc-gateway uses a client to read the response from the actual grpc server, and that client has a maxMsgSize limit? Is there a hook to override that?

Thanks!

@paulbdavis
Copy link

I was looking for this same answer and eventually came on this solution, for anyone else looking

opts := []grpc.DialOption{grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(16777216))}

This will set that message size on all calls for that endpoint hndler, not sure if this is the best solution, but it worked for me

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants