The problem is, at application startup, the RabbitListener runs before the eventProcessors have subscribed to the SpringAMQPMessageSource. As a result, the first events after startup are simply ignored.
I suspect this is a bug in my configuration.
Does anyone have any ideas what this could be??
I don’t think you’re facing a bug necessarily, but more so a configuration predicament.
To be frank with you, I don’t use RabbitMQ terrible often.
However, I am pretty certain there’s a means to have a RabbitListener annotated method wait before it is able to receive messages from the configured queue(s).
A quick google let me to find the autoStart property you can define on the annotation.
Perhaps setting that to false, and enabling it once the Axon Framework configuration is done works?
By the way, if you want to tap into the point when AF config is done, you can listen to the AxonStartedEventSpring Event. To listen to Spring events, you need to add an @EventListener annotated method (instead of Axon Framework’s @EventHandler annotated method.
I hope the above helps you further, Tino!
If not, be sure to reach out.