Merge pull request #2378 from vwoo/grpc_max_receive_message_length_ruby_doc

Show in gRPC Ruby doc how to avoid GRPC::ResourceExhausted exceptions
This commit is contained in:
Olaoluwa Osuntokun 2018-12-28 15:13:11 -06:00 committed by GitHub
commit 089d461552
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -171,3 +171,15 @@ stub = Lnrpc::Lightning::Stub.new(
# Now we don't need to pass the metadata on a request level
p stub.get_info(Lnrpc::GetInfoRequest.new)
```
#### Receive Large Responses
A GRPC::ResourceExhausted exception is raised when a server response is too large. In particular, this will happen with mainnet DescribeGraph calls. The solution is to raise the default limits by including a channel_args hash when creating our stub.
```ruby
stub = Lnrpc::Lightning::Stub.new(
'localhost:10009',
credentials,
channel_args: {"grpc.max_receive_message_length" => 1024 * 1024 * 50}
)
```