A hybrid application is one that both listens for HTTP requests, as well as makes use of connected microservices. The
INestApplication instance can be connected with
INestMicroservice instances through the
To connect multiple microservice instances, issue the call to
connectMicroservice() for each microservice:
@MessagePattern() to only one transport strategy (for example, MQTT) in a hybrid application with multiple microservices, we can pass the second argument of type
Transport which is an enum with all the built-in transport strategies defined.
NatsContextare imported from
By default a hybrid application will not inherit global pipes, interceptors, guards and filters configured for the main (HTTP-based) application.
To inherit these configuration properties from the main application, set the
inheritAppConfig property in the second argument (an optional options object) of the
connectMicroservice() call, as follow: