I'm curious about how or if others are handling synchronous processing of commands which are send from process managers/sagas. My current architecture assumes synchronous command handling in
ASP.NET MVC, i.e. controller -> command handler -> events -> persist in EventStore. Now, I'm looking at adding an event sourced process manager/saga for a certain case and I'm a little stuck at what to do with/where to send commands generated by the process manager. The process managers will be initiated and handled by one or more Event Processors running in a separate process. For the commands generated by the process manager, do I:
1. Submit them back through an API controller method and have them processed through MVC again.
2. Handle them immediately in the same process as the Event Processor.
In the second case, the flow would be something like this EventStoreSubscription -> Event -> Process Manager-> PM generates state events and commands -> Save PMstate events in EventStore and register future PM timeout event -> Command Handlers -> Aggregates -> Events -> Save Aggregate Events in Event Store. I'm leaning more toward the second option because I think the retry logic would be less complicated and it would be less prone to infrastructure problems. I'm still not sure what I would do with commands that just "disappeared" but the timeout event should give me a catch all solution to any unforeseen problems/bugs that come up when handling commands. I'm not saving the commands, so won't be able to retry them. Has anyone else done something like this? Any issues you experienced?
Thanks,
Jordan