Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
Support changing gRPC max message length
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples committed May 11, 2021
1 parent 4022469 commit d1724fc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |

<details>
<summary>
Expand Down
5 changes: 5 additions & 0 deletions server/temporal-client/temporal-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit d1724fc

Please sign in to comment.