Hi Filip,
From your description I get the idea you’ve got two identical Axon application, both listening to a queue and based on that you publish commands.
Through that approach it’s somewhat harder to coordinate which node will handle which aggregate.
Are the actions you try to take on the aggregate identical or two different actions?
The DistributedCommandBus is able to correctly coordinate which node will be in charge of firing a command for a given Aggregate.
It does that internally by using the RoutingStrategy
interface, which is a decision point for which node will handle which aggregate.
Doing this is also beneficial from that point that not more then one node would have to event source, and potentially cache, an aggregate.
So I’d suggest configuring a DistributedCommandBus in your application to deal with deciding which instance is gonna handle which aggregate.
Hope this helps Filip!
Cheers,
Steven