I’m using the Java Ledger Bindings to get packages from the ledger via the Package service and am getting the following error:
RESOURCE_EXHAUSTED: gRPC message exceeds maximum size
My application is based on the Ping-Pong example application and the daml model has about 300+ daml files.
The exception occurs around the following code block:
DamlLedgerClient client = DamlLedgerClient.forHostWithLedgerIdDiscovery(host, port, Optional.empty());
client.connect();
PackageClient packageService = client.getPackageClient();
Flowable<String> packagesIds = packageService.listPackages();
The message size is limited by the ManagedChannel
used to connect to the gRPC server. To increase it, you have to construct and configure the ManagedChannel
for gRPC yourself and pass it to the constructor of DamlLedgerClient
.
ManagedChannel channel =
ManagedChannelBuilder
.forAddress(host,port)
.usePlaintext()
.maxInboundMessageSize(9999999)
.build();
DamlLedgerClient client = new DamlLedgerClient(Optional.empty(), channel);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With