Closed gocandra closed 2 years ago
should I create an npm module with all message (commands / events) definitions
This is usually the easier path to take. A separate module that only contains your message definitions and is imported into your orchestrator and services.
This way your dependencies will stay loosely coupled, whilst still allowing any service to publish/subscribe to any message.
Fantastic! thank you very much for the quick reply! I'll try and contribute an article with a concrete implementation. cheers
i'm building a simple system consisting of an orchestrator and three microservices. should I define event classes in each service? or should I create an npm module with all message (commands / events) definitions? I'm thinking something like this
@org/bus-module
service#1 / servie#2 / servie#3
orchestrator
Would this implementation be correct? Is there any example of a different and better way?