Closed wi-ski closed 5 years ago
the command id identifies the command... it should be unique... it can be used to track the command accross the network or for possible deduplication etc...
:thinking: Is that like a correlation Id? Is there any reason not to use the name of the command? Like - have it be: "editAccount" instead of "as28-asd22-32222-91827"
the name of the command identifies the behaviour in your aggregate... it's not the identifier of that message... i.e. how do you distinguish 2 commands ('editAccount') that looks the same?
You could think of it as a request/transaction ID, it identifies this exact command "request", as a result a correlationId
with the exact same ID is attached to the resulted event(s) and even further notification(s) ( ie. readmodel events ) for tracking/coupling ( extremely important when working with a message bus ).
Yasss. Ok. Thank you both. Awesome library. Im trying to marry it with: https://moleculer.services/0.12/docs/ and its been a blast. #overEngineeringForFun.
On this line: https://github.com/adrai/cqrs-sample/blob/master/domain/server.js#L17 we are defining some Id. But we also define the
aggregateId
. What is the purpose ofid:
? Is it supposed to change? Be static?