It is not possible to use the same events between two aggregates. #272
Replies: 2 comments
-
This is expected behaviour, as events may trigger aggregate that have published them. |
Beta Was this translation helpful? Give feedback.
-
@dgafka My original idea was to use the same event for more than one stream. I have a business case that justifies this behavior. Looking for a similar solution I found that EventStoreDB gives the possibility to emit events by linking. However, the current implementation of I would like to keep this issue open for a while and try to come up with a proper solution. |
Beta Was this translation helpful? Give feedback.
-
Consider following scenario: The
Cycle
aggregate has the certificate issuing logic.Certificate
is an aggregate with functionalities independent ofCycle
, such as suspension.It is not possible to use the same events between aggregates when the
Certificate
aggregate factory method is anEventHandler
returning the event originally returned byCycle
. Both aggregates are saved correctly, but after saving theCertificate
, the publishedCertificateIssued
event causes a loop and triggers the factory method again for the same parameters.Proper PR with test case will be introduced.
Beta Was this translation helpful? Give feedback.
All reactions