A bigger picture of the problem… We have several instances of a given application, we are not using a DistributedCommandBus
, instead we’re using a distributed cache. We have found that there are some cases where a given command is executed with a stale version of the Aggregate. If that command execution generates events, it’s fine since there will be a concurrency exception thrown when inserting the generated events in the database. We will recover from this error by retrying the command with the correct version of the aggregate.
However, we have a very edge case where the stale aggregate would make the command to not apply any events when it should have. No errors will be generated so we cannot recover from that. Under circumstances where no events are applied, we still want to apply one dummy event that will act as a protection mechanism to detect that we actually handled the command with a stale version of the aggregate.
Hope I was able to summarize the problem more or less…