From d1724fc3be3f06ffdb472c16a2abc3468530cb24 Mon Sep 17 00:00:00 2001 From: feedmeapples Date: Mon, 10 May 2021 19:33:15 -0700 Subject: [PATCH] Support changing gRPC max message length --- README.md | 1 + server/temporal-client/temporal-client.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 767b35d9..6fb71bef 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Set these environment variables if you need to change their defaults | TEMPORAL_HOT_RELOAD_TEST_PORT | HTTP port used by hot reloading in tests | 8082 | | TEMPORAL_SESSION_SECRET | Secret used to hash the session with HMAC | "ensure secret in production" | | TEMPORAL_EXTERNAL_SCRIPTS | Additional JavaScript tags to serve in the UI | | +| TEMPORAL_GRPC_MAX_MESSAGE_LENGTH | gRPC max message length (bytes) | 4194304 (4mb) |
diff --git a/server/temporal-client/temporal-client.js b/server/temporal-client/temporal-client.js index 5e59f081..b739ab11 100644 --- a/server/temporal-client/temporal-client.js +++ b/server/temporal-client/temporal-client.js @@ -11,6 +11,9 @@ const { cliTransform, } = require('./helpers'); +const grpcMaxMsgLength = + Number(process.env.TEMPORAL_GRPC_MAX_MESSAGE_LENGTH) || 4 * 1024 * 1024; + function TemporalClient() { const dir = process.cwd(); const protoFileName = 'service.proto'; @@ -44,6 +47,8 @@ function TemporalClient() { const { credentials: tlsCreds, options: tlsOpts } = getCredentials(); + tlsOpts['grpc.max_receive_message_length'] = grpcMaxMsgLength; + let client = new service.temporal.api.workflowservice.v1.WorkflowService( process.env.TEMPORAL_GRPC_ENDPOINT || '127.0.0.1:7233', tlsCreds,