I am trying to configure a tracking event processor to keep track of events that were processed when the application restarts.
This is my configuration
`
Configurer configurer = DefaultConfigurer.defaultConfiguration()
.configureAggregate(MyAggregate.class)
.eventProcessing(eventProcessingConfigurer -> {
eventProcessingConfigurer.registerTokenStore(“default”, configuration -> JpaTokenStore.builder().entityManagerProvider(new SimpleEntityManagerProvider(emf.createEntityManager())).serializer(configuration.serializer()).build());
// If I comment out the above line the event handler works as expected. I assume it defaults to the InMemoryTokenStore which is why the events are processed every time the application restarts.
eventProcessingConfigurer.registerTrackingEventProcessor(“default”);
eventProcessingConfigurer.registerEventHandler(configuration -> new AggregateEventHandler());
});
Configuration configuration = configurer.start();
`
This is my event handler
`
@ProcessingGroup(“default”)
public class AggregateEventHandler {
@EventHandler
public void on(AggregateRegisteredEvent event) {
System.out.println(“Registered Event”);
}
@EventHandler
public void on(AggregateUpdatedEvent event) {
System.out.println(“Updated Event”);
}
}
`
From the log I can see that the JPA connection is successful and the TOKENENTRY table is created but no record is inserted.
Am I missing a configuration?
Thanks