Hi I have the following senario which I dont understand how to get eventual consistency with:
- User 1 uses Task based ui to change customer name
- App Service calls operation on the aggregate
- Aggregate fires event on customername changed
- bus sends message using nservicebus
- NServicebus service dies
- User 2 gets aggregate and calls change address
- Aggregate operation called
- Domain event fired
- Message put on bus
- Bus restarts
- Message 2 picked up first
- Message 2 processed and other Bounded context updated with new address
- Message 1 picked up now which is wrong order
- What happens now
In 13 would there be an optimistic concurrency error if we pass the version of the aggregate in the event?
If so Message 1 new gets applied to object in the other context. How do we even maintain consistency?
This is the issue that is preventing me applying events in my domain. All help welcome.
The essential idea is to update another aggregate in another context. I am just stuck on the concurrency technicalities of this.
We are not using event sourcing or CQRS in the sense of commandhandler and commands push on the bus. It is only the event processing we want to happen asynchronously as we have an existing design which we do not wish to change.
Blair