Skip to content

Commit

Permalink
Merge pull request #47 from Clarifai/mrk-3106
Browse files Browse the repository at this point in the history
[MRK-3106]Set max message length to 128MB
  • Loading branch information
YvetteZ2017 authored Aug 31, 2023
2 parents 8d67abd + b179396 commit 2af7601
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/clarifai/channel/ClarifaiChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public enum ClarifaiChannel {

INSTANCE;

public static final int MAX_MESSAGE_LENGTH = 128 * 1024 * 1024; // 128MB

private enum MarshallerType {
PROTO,
JSON,
Expand All @@ -33,6 +35,7 @@ public ManagedChannel getGrpcChannel(String base) {
marshallerType = MarshallerType.PROTO;
return NettyChannelBuilder
.forAddress(base, 443)
.maxInboundMessageSize(MAX_MESSAGE_LENGTH)
.sslContext(
GrpcSslContexts.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
Expand All @@ -50,6 +53,7 @@ public ManagedChannel getInsecureGrpcChannel() {
return NettyChannelBuilder
.forAddress("api-grpc.clarifai.com", 18080)
.usePlaintext()
.maxInboundMessageSize(MAX_MESSAGE_LENGTH)
.build();
}

Expand Down

0 comments on commit 2af7601

Please sign in to comment.