mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-19 16:57:40 +03:00
Raise the default size of inbound message size in java bindings (#19325)
This commit is contained in:
parent
798f7d8bf4
commit
632d114191
@ -45,6 +45,8 @@ public final class DamlLedgerClient implements LedgerClient {
|
||||
private Optional<String> accessToken = Optional.empty();
|
||||
private Optional<Duration> timeout = Optional.empty();
|
||||
|
||||
public static final int DefaultMaxInboundMessageSize = 10 * 1024 * 1024;
|
||||
|
||||
private Builder(@NonNull NettyChannelBuilder channelBuilder) {
|
||||
this.builder = channelBuilder;
|
||||
this.builder.usePlaintext();
|
||||
@ -66,6 +68,11 @@ public final class DamlLedgerClient implements LedgerClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder withMaxInboundMessageSize(int maxInboundMessageSize) {
|
||||
this.builder.maxInboundMessageSize(maxInboundMessageSize);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DamlLedgerClient build() {
|
||||
return new DamlLedgerClient(this.builder, this.accessToken, this.timeout);
|
||||
}
|
||||
@ -83,7 +90,9 @@ public final class DamlLedgerClient implements LedgerClient {
|
||||
* builder's capabilities
|
||||
*/
|
||||
public static Builder newBuilder(@NonNull String host, int port) {
|
||||
return new Builder(NettyChannelBuilder.forAddress(host, port));
|
||||
return new Builder(
|
||||
NettyChannelBuilder.forAddress(host, port)
|
||||
.maxInboundMessageSize(Builder.DefaultMaxInboundMessageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user