@nestjs-mod/microservices
v1.11.0
Published
NestJS microservice modules for NestJS-mod
Maintainers
Readme
@nestjs-mod/microservices
NestJS microservice modules for NestJS-mod
[![NPM version][npm-image]][npm-url] [![monthly downloads][downloads-image]][downloads-url] [![Telegram][telegram-image]][telegram-url] [![Discord][discord-image]][discord-url]
Installation
npm i --save @nestjs/microservices @nestjs-mod/microservicesModules
| Link | Category | Description | | ----------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------ | | GrpcNestMicroservice | system | GRPC NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/grpc | | GrpcNestMicroserviceClientModule | system | GRPC NestJS-mod microservice client @see https://docs.nestjs.com/microservices/grpc | | KafkaNestMicroservice | system | Kafka NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/kafka | | KafkaNestMicroserviceClientModule | system | Kafka NestJS-mod microservice client @see https://docs.nestjs.com/microservices/kafka | | MqttNestMicroservice | system | MQTT NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/mqtt | | MqttNestMicroserviceClientModule | system | MQTT NestJS-mod microservice client @see https://docs.nestjs.com/microservices/mqtt | | NatsNestMicroservice | system | Nats NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/nats | | NatsNestMicroserviceClientModule | system | Nats NestJS-mod microservice client @see https://docs.nestjs.com/microservices/nats | | RedisNestMicroservice | system | Redis NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/redis | | RedisNestMicroserviceClientModule | system | Redis NestJS-mod microservice client @see https://docs.nestjs.com/microservices/redis | | RmqNestMicroservice | system | RabbitMQ NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/rabbitmq | | RmqNestMicroserviceClientModule | system | RabbitMQ NestJS-mod microservice client @see https://docs.nestjs.com/microservices/rabbitmq | | TcpNestMicroservice | system | TCP NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/basics | | TcpNestMicroserviceClientModule | system | TCP NestJS-mod microservice client @see https://docs.nestjs.com/microservices/basics |
Modules descriptions
GrpcNestMicroservice
GRPC NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/grpc
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| ----- | ----------- | --------------------------------------- | ------------ | ------- | ----- |
| url | Url | obj['url'], process.env['GRPC_URL'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| maxSendMessageLength | Max send message length | optional | - | - |
| maxReceiveMessageLength | Max receive message length | optional | - | - |
| maxMetadataSize | Max metadata size | optional | - | - |
| keepalive | Keepalive | optional | - | - |
| channelOptions | Channel options | optional | - | - |
| credentials | Credentials | optional | - | - |
| protoPath | Proto path | optional | - | - |
| package | Package | isNotEmpty (package should not be empty) | - | - |
| protoLoader | Proto Loader | optional | - | - |
| packageDefinition | Package definition | optional | - | - |
| gracefulShutdown | GracefulShutdown | optional | - | - |
| loader | Loader | optional | - | - |
GrpcNestMicroserviceClientModule
GRPC NestJS-mod microservice client @see https://docs.nestjs.com/microservices/grpc
Shared providers
GrpcNestMicroserviceClient, ClientProxyApplicationHooks
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| ----- | ----------- | --------------------------------------- | ------------ | ------- | ----- |
| url | Url | obj['url'], process.env['GRPC_URL'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| maxSendMessageLength | Max send message length | optional | - | - |
| maxReceiveMessageLength | Max receive message length | optional | - | - |
| maxMetadataSize | Max metadata size | optional | - | - |
| keepalive | Keepalive | optional | - | - |
| channelOptions | Channel options | optional | - | - |
| credentials | Credentials | optional | - | - |
| protoPath | Proto path | optional | - | - |
| package | Package | isNotEmpty (package should not be empty) | - | - |
| protoLoader | Proto Loader | optional | - | - |
| packageDefinition | Package definition | optional | - | - |
| gracefulShutdown | GracefulShutdown | optional | - | - |
| loader | Loader | optional | - | - |
KafkaNestMicroservice
Kafka NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/kafka
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| --------- | ----------- | ------------------------------------------------ | ------------ | ------- | ----- |
| brokers | Brokers | obj['brokers'], process.env['KAFKA_BROKERS'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| serializer | Serializer | optional | - | - |
| deserializer | Deserializer | optional | - | - |
| postfixId | Defaults to "-server" on server side and "-client" on client side | optional | - | - |
| client | Client | optional | - | - |
| consumer | Consumer config | optional | - | - |
| run | Consumer run config | optional | - | - |
| subscribe | Subscribe | optional | - | - |
| producer | Producer config | optional | - | - |
| send | Send producer record | optional | - | - |
| parser | Kafka parser config | optional | - | - |
| producerOnlyMode | Producer only mode | optional | - | - |
KafkaNestMicroserviceClientModule
Kafka NestJS-mod microservice client @see https://docs.nestjs.com/microservices/kafka
Shared providers
KafkaNestMicroserviceClient, ClientProxyApplicationHooks
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| --------- | ----------- | ------------------------------------------------ | ------------ | ------- | ----- |
| brokers | Brokers | obj['brokers'], process.env['KAFKA_BROKERS'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| serializer | Serializer | optional | - | - |
| deserializer | Deserializer | optional | - | - |
| postfixId | Defaults to "-server" on server side and "-client" on client side | optional | - | - |
| client | Client | optional | - | - |
| consumer | Consumer config | optional | - | - |
| run | Consumer run config | optional | - | - |
| subscribe | Subscribe | optional | - | - |
| producer | Producer config | optional | - | - |
| send | Send producer record | optional | - | - |
| parser | Kafka parser config | optional | - | - |
| producerOnlyMode | Producer only mode | optional | - | - |
MqttNestMicroservice
MQTT NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/mqtt
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| ----- | ----------- | --------------------------------------- | ------------ | ------- | ----- |
| url | Url | obj['url'], process.env['MQTT_URL'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| serializer | Serializer | optional | - | - |
| deserializer | Deserializer | optional | - | - |
| subscribeOptions | Subscribe options | optional | - | - |
| userProperties | User properties | optional | - | - |
MqttNestMicroserviceClientModule
MQTT NestJS-mod microservice client @see https://docs.nestjs.com/microservices/mqtt
Shared providers
MqttNestMicroserviceClient, ClientProxyApplicationHooks
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| ----- | ----------- | --------------------------------------- | ------------ | ------- | ----- |
| url | Url | obj['url'], process.env['MQTT_URL'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| serializer | Serializer | optional | - | - |
| deserializer | Deserializer | optional | - | - |
| subscribeOptions | Subscribe options | optional | - | - |
| userProperties | User properties | optional | - | - |
NatsNestMicroservice
Nats NestJS-mod microservice initializer @see https://docs.nestjs.com/microservices/nats
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| --------- | ----------- | ----------------------------------------------- | ------------ | ------- | ----- |
| name | Name | obj['name'], process.env['NATS_NAME'] | optional | - | - |
| user | User | obj['user'], process.env['NATS_USER'] | optional | - | - |
| pass | Pass | obj['pass'], process.env['NATS_PASS'] | optional | - | - |
| servers | Servers | obj['servers'], process.env['NATS_SERVERS'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| headers | Headers | optional | - | - |
| authenticator | Authenticator | optional | - | - |
| debug | Debug | optional | - | - |
| ignoreClusterUpdates | Ignore cluster updates | optional | - | - |
| inboxPrefix | Inbox prefix | optional | - | - |
| encoding | Encoding | optional | - | - |
| maxPingOut | Max ping out | optional | - | - |
| maxReconnectAttempts | Max reconnect attempts | optional | - | - |
| reconnectTimeWait | Reconnect time wait | optional | - | - |
| reconnectJitter | Reconnect jitter | optional | - | - |
| reconnectJitterTLS | Reconnect jitter TLS | optional | - | - |
| reconnectDelayHandler | Reconnect delay handler | optional | - | - |
| nkey | Nkey | optional | - | - |
| reconnect | Reconnect | optional | - | - |
| pedantic | Pedantic | optional | - | - |
| tls | TLS | optional | - | - |
| queue | Queue | optional | - | - |
| serializer | Serializer | optional | - | - |
| deserializer | Deserializer | optional | - | - |
| userJWT | User JWT | optional | - | - |
| nonceSigner | Nonce signer | optional | - | - |
| userCreds | User creds | optional | - | - |
| useOldRequestStyle | Use old request style | optional | - | - |
| pingInterval | Ping interval | optional | - | - |
| preserveBuffers | Preserve buffers | optional | - | - |
| waitOnFirstConnect | Wait on first connect | optional | - | - |
| verbose | Verbose | optional | - | - |
| noEcho | No echo | optional | - | - |
| noRandomize | No randomize | optional | - | - |
| timeout | Timeout | optional | - | - |
| token | Token | optional | - | - |
| yieldTime | Yield time | optional | - | - |
| tokenHandler | Token handler | optional | - | - |
NatsNestMicroserviceClientModule
Nats NestJS-mod microservice client @see https://docs.nestjs.com/microservices/nats
Shared providers
NatsNestMicroserviceClient, ClientProxyApplicationHooks
Static environments
| Key | Description | Sources | Constraints | Default | Value |
| --------- | ----------- | ----------------------------------------------- | ------------ | ------- | ----- |
| name | Name | obj['name'], process.env['NATS_NAME'] | optional | - | - |
| user | User | obj['user'], process.env['NATS_USER'] | optional | - | - |
| pass | Pass | obj['pass'], process.env['NATS_PASS'] | optional | - | - |
| servers | Servers | obj['servers'], process.env['NATS_SERVERS'] | optional | - | - |
Static configuration
| Key | Description | Constraints | Default | Value |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | ----- |
| defaultLogger | Default logger for application | optional | - | - |
| logger | Specifies the logger to use. Pass false to turn off logging. | optional | - | - |
| abortOnError | Whether to abort the process on Error. By default, the process is exited. Pass false to override the default behavior. If false is passed, Nest will not exit the application and instead will rethrow the exception. @default true | optional | - | - |
| bufferLogs | If enabled, logs will be buffered until the "Logger#flush" method is called. @default false | optional | - | - |
| autoFlushLogs | If enabled, logs will be automatically flushed and buffer detached when application initialization process either completes or fails. @default true | optional | - | - |
| preview | Whether to run application in the preview mode. In the preview mode, providers/controllers are not instantiated & resolved. @default false | optional | - | - |
| snapshot | Whether to generate a serialized graph snapshot. @default false | optional | - | - |
| featureName | Feature name for generate prefix to environments keys | optional | - | - |
| microserviceProjectName | Microservice project name for generate prefix to environments keys (need only for microservice client) | optional | - | - |
| headers | Headers | optional | - | - |
| authenticator | Authenticator | optional | - | - |
| debug | Debug | optional | - | - |
| ignoreClusterUpdates | Ignore cluster updates | optional | - | - |
| inboxPrefix | Inbox prefix | optional | - | - |
| encoding | Encoding | optional | - | - |
| maxPingOut | Max ping out | optional | - | - |
| maxReconnectAttempts | Max reconnect attempts | optional | - | - |
| reconnectTimeWait | Reconnect time wait | optional | - | - |
| reconnectJitter | Reconnect jitter | optional | - | - |
| reconnectJitterTLS | Reconnect jitter TLS | optional | - | - |
| reconnectDelayHandler | Reconnect delay handler | optional | - | - |
| nkey |
