mirror of
https://github.com/nestjs/nest.git
synced 2026-02-21 23:11:44 +00:00
Merge branch 'bugfix/grpc-options' of https://github.com/sjkummer/nest into sjkummer-bugfix/grpc-options
This commit is contained in:
@@ -90,6 +90,7 @@ export class ClientGrpcProxy extends ClientProxy implements ClientGrpc {
|
||||
|
||||
const keepaliveOptions = this.getKeepaliveOptions();
|
||||
const options: Record<string, string | number> = {
|
||||
...this.options.channelOptions,
|
||||
...maxMessageLengthOptions,
|
||||
...keepaliveOptions,
|
||||
};
|
||||
|
||||
22
packages/microservices/external/grpc-options.interface.ts
vendored
Normal file
22
packages/microservices/external/grpc-options.interface.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* An interface that contains options used when initializing a Channel instance.
|
||||
* This listing is incomplete. Full reference: https://grpc.github.io/grpc/core/group__grpc__arg__keys.html
|
||||
*/
|
||||
export interface ChannelOptions {
|
||||
'grpc.ssl_target_name_override'?: string;
|
||||
'grpc.primary_user_agent'?: string;
|
||||
'grpc.secondary_user_agent'?: string;
|
||||
'grpc.default_authority'?: string;
|
||||
'grpc.keepalive_time_ms'?: number;
|
||||
'grpc.keepalive_timeout_ms'?: number;
|
||||
'grpc.service_config'?: string;
|
||||
'grpc.max_concurrent_streams'?: number;
|
||||
'grpc.initial_reconnect_backoff_ms'?: number;
|
||||
'grpc.max_reconnect_backoff_ms'?: number;
|
||||
'grpc.use_local_subchannel_pool'?: number;
|
||||
'grpc.max_send_message_length'?: number;
|
||||
'grpc.max_receive_message_length'?: number;
|
||||
[key: string]: string | number | undefined;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import { Server } from '../server/server';
|
||||
import { CustomTransportStrategy } from './custom-transport-strategy.interface';
|
||||
import { Deserializer } from './deserializer.interface';
|
||||
import { Serializer } from './serializer.interface';
|
||||
import {ChannelOptions} from '../external/grpc-options.interface';
|
||||
|
||||
export type MicroserviceOptions =
|
||||
| GrpcOptions
|
||||
@@ -42,6 +43,7 @@ export interface GrpcOptions {
|
||||
http2MinPingIntervalWithoutDataMs?: number;
|
||||
http2MaxPingStrikes?: number;
|
||||
};
|
||||
channelOptions?: ChannelOptions;
|
||||
credentials?: any;
|
||||
protoPath: string | string[];
|
||||
package: string | string[];
|
||||
|
||||
Reference in New Issue
Block a user