We are prototyping an application with Spring Boot, Axon framework, and Axon server. (At the present state, all Axon configurations are at their default state - we haven’t implemented any configuration beans for this.)
In testing, I am sending a command that triggers an aggregate, and some additional events, internal Axon commands, projections, and external interactions.
All this seems to be working well enough, but if I stop the application and then restart it, I am seeing events being redelivered to all of the non-aggregate event listeners. @AllowReplay(false) does not prevent this. It seems likely that the Axon framework is not detecting the fact that the events have already been delivered, but this is causing the event handlers to repeat external interactions inappropriately.
Most likely this is a configuration error on my part, as I’m new to the Axon ecosystem. But I haven’t found anything obvious yet.
How do I prevent these events from being redelivered when the application is restarted, or redesign my events and commands to avoid this pitfall?