Summary
At the beginning of this chapter, we stated “microservice” was a misleading name for this part of Nest.js. In fact, that could still be the case, but it really depends on a number of factors. Our initial example using the TCP transport could hardly qualify as a microservice by all conventional definitions. Both the NestApplication and NestMicroservice context were executing from the same process, meaning a catastrophic failure in one could bring both down.
After highlighting all the transports, Nest.js comes with out-of-the-box, and we re-implemented our microservices in the example blog application using a custom RabbitMQ transport. We even went as far as running the NestApplication and NestMicroservice contexts in their own thread. This was a major step in the right direction for fulfilling the “microservice” name.
Although we didn’t cover specifics in this book, it should now be apparent that you’re not limited to using microservices...