I'm using (the excellent) NEventStore to persist a stream of aggregate root events. In response to some state changes the aggregate dispatches commands to another endpoint. The aggregate root sends the command using a service that's passed in. This works fine whilst using msdtc but obviously at a cost.
Having witnessed the evil that is 2pc I'd now like to move to a architecture that has fault-tolerance built in. I understand that, during start up, NEventStore will automatically dispatch events that previously failed.
Does this suggest that all external state changing functionality should occur after the aggregate's events have been successfully dispatched, ie dispatch commands to the other endpoint in response to specific events from within the IDispatchCommits.Dispatch method?
Or, perhaps a unit-of-work would be better?