Inter-aggregate communication using events

Does Axon framework supports events sent to other aggregates without a command? In CQRS Journey book I read:

The Event handler performs the following tasks:

  1. It receives an Event instance from the messaging infrastructure.
  2. It locates the aggregate or process manager instance that is the target of the event. This may involve creating a new aggregate instance or locating an existing instance.
  3. It invokes the appropriate method on the aggregate or process manager instance, passing in any parameters from the event.
  4. It persists the new state of the aggregate or process manager to storage.

In the docs I read that the TargetAggregateIdentifier annotation can be used only in command class, why it it not possible in event class as well?



This need exists in some cases, but you have to go through a separated event handler and make specific commands and dedicated state altering events for the target aggregate.

The reason for this is that an aggregate is king of its own internal state at all times.
You can ASK it to change via a command -that can be refused- but you cannot TELL it to change with an event that originated outside its control.

All considered, I think it’s good that it is not supported in Axon an the overhead forces you to take the time to reconsider other designs.