I have a spring boot application with axon server, when i restart the application i noticed that all the events replay automatically, so my question is why the events replay automatically and how can i stop them (it means when i start the application i don’t want the events to replay) ?
Hi Rayen
You probably don’t have any relational database connected to you application yet. If so, by auto configuration that database would be used as token store. The mongo extension also offers a token store, when MongoDB is used.
By default an in memory token store is used. Also by default, each streaming event processor will start from the beginning, when no token can be found. If you want to know more about token stores and their relation with event processors, you can read the reference guide.
My question to you is how do you know Axon is replaying events?
If you don’t have Axon configuration (in Java or yml) to process classes annotated with @ProcessingGroup and if you don’t have any methods annotated with @EventHandler, Axon should not play any events. Make sure you check the 2 annotations listed above in your code.
Also Axon event can be setup in application.yml so check there as well.