I am using Axon4 with Spring boot. Created simple saga. Its works well during JVM in flight. However once it restarts, it re-runs the Saga again.
Tried to to JpaSagaStore for persistance, did not work. Below are code snippet. Please help.
@Configuration
public class AxonConfig {
@PersistenceContext
private EntityManager entityManager;
@Bean
public SagaStore sagaStore() {
return JpaSagaStore.builder().entityManagerProvider(new SimpleEntityManagerProvider(entityManager)).build();
}
}