nestjs-microservice-architecture
nestjs-microservice-architecture copied to clipboard
Consider adding example with ClientsModule instead of @Client decorator
As per in docs: "However, using decorator is not a recommended way (hard to test, tough to share client instance)."
https://docs.nestjs.com/microservices/basics
You can instead use the ClientsModule.register() method to register the microservice as an injectable service. A separate example of this may be helpful.
@Hughp135 Thanks for your interest in the repository. I'm starting to come back to actually do some work on this again and try and turn it into a true reference application. I have a few issues I want to work through but I'll take a look at this right after.
One thing that I've been considering is whether or not I actually want to proceed using the built in @nest/microservices implementation as the API for it is somewhat limited due to the desire to keep it compatible with a variety of different transport mechanisms. For example, I've built out a library for microservice communication over RabbitMQ https://github.com/WonderPanda/nestjs-plus which provides much better support for microservice design by actually leveraging features of the underlying transport.
If you have any thoughts or suggestions around this I'd love to hear them.