How to use snapshot in @EventHandler

Hello everyone, I’m learning the demo (giftcard) on the official website of axon. I found that even after I create a snapshot, restarting @ event Handel will load all events. I hope to save the projection in MySQL and let @ event Handel only perform operations on new events. What should I do?

use StreamingEventProces

Typically when building a projection, using a streaming event processor, you use a token store for the same database, so you can easily catch up from where you where. This is not related to snapshotting, which is about the aggregate state.

In your case, using Spring Boot, I would expect an EntityManager or DataSource to be available. Please see also the reference guide about the token store.

Thank you for your reply. After I used JPA configuration, I encountered a new problem, @ EventHandler missed event processing. Did I miss any configuration?

I’m not sure I understand the problem you have, could you please expand a bit?

I try to configure MySQL and JPA in application Properties, I found that the token has been recorded in mysql, but at this time, @ EventHandler missed event processing, and token refresh quickly