I am putting together an app with Axon 2.3.2, Spring Context 4.1.1 and Spring Boot 1.1.8.
I followed the getting started tutorial, and all was fine.
Then I refactored my code to pull the command handlers and event handlers into separate classes ie outside the aggregate root (ToDoItem!)
The command handlers are called, but only the event handler I left in the aggrate root is called - my external event handlers are not called.
The only way I can get Axon to call the external handlers is to not do the apply() in the ToDoItem constructor, but instead have the command handler method that created the ToDoItem add it to the repository, then call a method in the ToDoItem, which does the apply(). But then my external event handler method is called twice.
The same happens if I try to use an EventTemplate in the command handler, instead of using the apply() in the aggregate root constructor.
I started by avoiding any spring/axon xml config, instead using annotations throughout, but my annotated event handlers are never called.
I now use only xml, but my annotated external event handlers are either never called, or called twice if I add them to the repository.
Does the apply() only trigger the @EventHandler methods in the aggregate root?
Spinning my wheels here - please help!