nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.28k stars 7.59k forks source link

How to add keepalive options in grpc client? #4094

Closed CatsMiaow closed 4 years ago

CatsMiaow commented 4 years ago

I did not find it when I searched with keepalive on Discord.

Fixing a connection issue in an AWS environment requires the keepalive setting in the grpc client option.

'grpc.keepalive_time_ms': 120000,
'grpc.http2.min_time_between_pings_ms': 120000,
'grpc.keepalive_timeout_ms': 20000,
'grpc.http2.max_pings_without_data': 0,
'grpc.keepalive_permit_without_calls': 1

https://github.com/nestjs/nest/blob/master/packages/microservices/client/client-grpc.ts#L67-L95 https://github.com/nestjs/nest/blob/master/packages/common/interfaces/microservices/microservice-configuration.interface.ts#L28-L51 It appears that we currently only support two(grpc.max_send_message_length, grpc.max_receive_message_length) options.

Let me know if there's a way to set it up.

Note link.

kamilmysliwiec commented 4 years ago

Would you like to create a PR for this issue? It seems that this is not possible currently.

kamilmysliwiec commented 4 years ago

Added in 6.11.9