I am facing issues with @EventHandler mechanism (most likely due to a mistake on my part I assume).
I am using Axon 3.0.2 and I committed my code on https://github.com/teivah/testaxon.
Basically what I’m trying to achieve is from com.test.axonpoc.AxonpocTest to send two commands: FPCreateCommand and FPEnableCommand.
There’s a handler on both (FPCommandHandler) but the second one invokes FP.enable(boolean). This second method does an apply to publish the event FPEnabledEvent. This is where the issue arise.
I would like basically to have two different handler types on the FPEnabledEvent event: an @EventSourcingHandler (in FP) and one or several @EventHandler (in FPView).
What I can see in the logs in that the @EventSourcingHandler method is correctly invoked. Nonetheless the @EventHandler method is never called.
I saw in another thead that Allard Buijze said: “When the command handler completes succesfully, the event is published to all @EventHandler components in the application, via the Event Bus.”.
Does it mean then I miss something in my @CommandHandler method? I cannot tell by myself…
Thanks for your help guys!