diff --git a/src/grpc.ts b/src/grpc.ts index 5fde573d2..177781456 100644 --- a/src/grpc.ts +++ b/src/grpc.ts @@ -423,6 +423,9 @@ export class GrpcClient { } grpcOptions[key] = value as string | number; } + if (key.startsWith('grpc-node.')) { + grpcOptions[key] = value as string | number; + } }); const stub = new CreateStub( serviceAddress, diff --git a/test/unit/grpc.ts b/test/unit/grpc.ts index 42f0b023f..56d0b36da 100644 --- a/test/unit/grpc.ts +++ b/test/unit/grpc.ts @@ -188,6 +188,7 @@ describe('grpc', () => { }, 'grpc.channelFactoryOverride': () => {}, 'grpc.gcpApiConfig': {}, + 'grpc-node.max_session_memory': 10, }; // @ts-ignore return grpcClient.createStub(DummyStub, opts).then(stub => { @@ -201,6 +202,7 @@ describe('grpc', () => { 'callInvocationTransformer', // note: no grpc. prefix for grpc-gcp options 'channelFactoryOverride', 'gcpApiConfig', + 'grpc-node.max_session_memory', ].forEach(k => { assert(stub.options.hasOwnProperty(k)); }); @@ -214,6 +216,10 @@ describe('grpc', () => { (dummyStub.options['callInvocationTransformer'] as Function)(), 42 ); + assert.strictEqual( + dummyStub.options['grpc-node.max_session_memory'], + 10 + ); ['servicePath', 'port', 'other_dummy_options'].forEach(k => { assert.strictEqual(stub.options.hasOwnProperty(k), false); });