Projections should never do behaviours.
Your email service should be resilient to duplicate messages for one. But you have a bigger issue. You don't do anything except set state when hydrating.
Your email service should be resilient to duplicate messages for one. But you have a bigger issue. You don't do anything except set state when hydrating.
The answer is not one of these.
The answer is not one of these.
Yes n infrastructure service can be used for this...
A question to ask yourself though. If its temporarily failing should
we reject the transaction? There are times when the answer to this
question is a yes but more often than not its a no. If I can't send an
email right now to confirm your order should I not accept your order?
Greg
I am giving a generalized answer (its not always just email). What
about charging a credit card, writing a transaction to the accounting
system, or telling inventory to move the item to shipping ....
There are loads of cases where you don't want it done as part of the
transaction for the command but prefer to do it from an event (but not
in a projection). This is where long running workflows (process
managers/sagas/whatever you want to call them) come in.
Greg