Let's say one is building a distributed system and is evaluating CQRS/
Axon for it. The system is deployed to several sites which are
occasionally connected via sat link. there wil be messaging middelware
to handle the sending of events between those sites.
Some of the sites will be running web servers for reporting while some
other sites will be running Eclipse RCP applications accessing a local
One site will designated master, and being responsible for keeping all
aggregates in the system for restore when any site has a data loss
(disk crash ...)
Here is a scenario:
- The UI in one of the RCP apps on site A issues an AddActivityCommand
with some timing data, project id, description etc.
- A command handler on the site A server receives the command,
processes it through it's local domain, an Activity aggregate is added
to the local repository and an ActivityAddedEvent is fired.
- The ActivityAddedEvent(AAE) now travels around.
- The AAE hits the site A view database updater and the local view
database is updated.
- The AAE hits the messaging middleware and travels eventually across
to the other sites.
- On the Master site the AAE arrives on the EventBus.
And this is where I wonder what is best practice.
- Should there be an eventhandler here that issues a new
ActivityCreatedCommand for the master domain to process? This will
result in a new AAE fired here and we have a loop.