Kest

Search

Search the documentation

Microservices

NestJS microservices parity

Which NestJS microservice features Kest has, and where they are.

Kest follows the NestJS microservices model. This table lists each NestJS feature, what Kest has in its place, and where to read about it.

NestJSKestStatus
NestFactory.createMicroservice(AppModule, options)createMicroservice<AppModule>(options), then listen() and await()done
app.connectMicroservice() and app.startAllMicroservices() (hybrid)connectMicroservice(options), startAllMicroservices(), http(...)done
Transport.TCP, Transport.REDIS, Transport.NATS, Transport.MQTT, Transport.KAFKA, Transport.RMQTcpOptions, RedisOptions, NatsOptions, MqttOptions, KafkaOptions, RmqOptionsdone
Transport.GRPC (server)@GrpcMethod, streams, grpc(...)done
Transport.GRPC (ClientGrpc)GrpcClient(host, port, schema, codec): unary, serverStream, clientStream, bidi, by service and method namedone
Custom transport strategyMicroserviceTransport (listen, close) and ClientTransportdone
@MessagePattern, @EventPattern@MessagePattern, @EventPatterndone
Object patterns ({ cmd: 'sum' })@MessagePattern("""{"cmd":"sum"}""") and send(mapOf(...))done
@Payload() and @Payload('field')@Payload and @Payload("field")done
@Ctx() and the broker contexts (KafkaContext, RmqContext, NatsContext, MqttContext, RedisContext)@Ctx, or a parameter of the context typedone
ClientProxy.send, emitsend, ask (suspend), sendAsync, emitdone
ClientsModule.register, registerAsyncClientsModule.register, registerAsyncdone
RpcException with an error objectRpcException(message, status, error)done
Pipes, guards, interceptors and exception filters on handlersthe same pipeline as HTTP, with the message as the requestdone
retryAttempts, retryDelaythe same names on each options classdone
Kafka groupId, fromBeginning, run optionsgroupId, fromBeginning; manual commits, dead-letter topicdone
RabbitMQ noAck, prefetchCount, queueOptionsacknowledgement by hand, prefetch, dead-letter exchangedone
NATS queuequeuedone
serializer and deserializer per transportnot yet: the envelope is the NestJS JSON formatgap
getService (generated typed stubs for gRPC clients)calls by service and method name; no generated stubsgap
Graceful shutdown (enableShutdownHooks)done: close() stops every transport and the container, and the JVM shutdown hook calls itdone
Testing with a microservice in a test moduleTesting.createModule, createMicroservice on a free portdone

Beyond NestJS: supervised consumers and workers that restart when they crash, a heartbeat watchdog, and actors whose mailboxes survive a crash. See Supervision.

Read more