Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
anabeto93
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Are domain events dispatched from reactors stored as part of the aggregate?
Consider a situation I am trying to deal with. A user requests to link a payment source to their wallet and the UserAggregateRoot records an event that, UserRequestedToLinkPaymentSource and there is a UserActivityReactor that listens for this event and then attempts to process payment through an external payment gateway... now this gateway (a microservice) could actually work by returning a 202 (processing payment) or fail immediately if the payment source is invalid for some reason, eg. invalid card pan, or fails the luhn check, I wish to dispatch an event, CouldNotLinkPaymentSource event and then also throw a CannotLinkPaymentSource exception.
I would like to know if domain events can be dispatched in a such a manner and are those events going to be stored by the aggregate? During a replay, will those events be available? I want to setup a TransactionHistoryProjector that will listen for the CouldNotLinkPaymentSource event.
Kindly assit.
Beta Was this translation helpful? Give feedback.
All reactions