By this I think you mean that; if the process fails between Publishing an event and Acknowledgement of a Command; the event will be redelivered and processed resulting, again, in republishing of the event and acknowledgement of the command, but this time the event is ignored by the store, as this previously succeeded, but the command is Acknowledged. Only problem is how would I implement deterministic id, given the event is created by the process. This is my factoring of a Message
class Message{
public Guid Id;
public Guid CorralationId;
public CausationId;
public Message(Message from){
Id = Guid.NewGuid();
CorralationId = from.CorrolationId
CausationId = from.Id;
}
}
And this a possible process
class PlaceOrderProcess(){
void Handle(PlaceOrder message){
EventStore.Publish(new ReduceInventory(placeOrder))
}
void Handle(InvantoryReduced message){
EvenetStore.Publish(....)
}
}
Only Causation and Correlation will be the same between multiple executions of of PlaceOrderProcess for the same PlaceOrder message. Should Message.id be a hash of these to make it deterministic instead of Guid.NewGuid() ?