Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How do I override maxMsgSize? #445

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

How do I override maxMsgSize? #445

fiibbb opened this issue Aug 18, 2017 · 1 comment

Comments

@fiibbb
Copy link

fiibbb commented Aug 18, 2017

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!

@fiibbb fiibbb closed this as completed Aug 19, 2017
@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

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

No branches or pull requests

2 participants