Hi, Allard,
Thanks for looking into this!
I was doubting myself abotu the JPA/JDBC difference, that’s why i deleted the post (i thought). I could not reproduce it with JPA but it is very difficult to reproduce it with JDBC either. Stil tweaking with all the different parameters to get a real producable test setup, so i can rule things out after that.
The missing event handling is certaintly in a different batch the the first ones… I will post an example below …
Could it be a conflict with the existing configuration ? Axon is brought in into this existing component. Some conflict, e.g. with the existing transaction handling ??? have a look below at springs DataSourceTransactionManager. Or could it have to do with the caching i have implemented ? I have posted (part of) the new and existing configuration below…
It also is good to know that afterwards (no idea how long you have to wait) new events are handled normally again on the same (corrupted) saga.
Thanks,
Gerlo
Events : (token, aggregateId, sequencenumber, payloadtype,)
handled:
400,100000040,1,nl.kadaster.koers.dossier.events.DossierAangemaakt (Start of saga)
401,100000040,2,nl.kadaster.koers.dossier.events.stuk.StukIdAangeboden
402,100000040,3,nl.kadaster.koers.dossier.events.stuk.TerInschrijvingAangebodenStukAangeboden
not handled:
505,100000040,4,nl.kadaster.koers.dossier.events.adres.ObjectLocatieBinnenlandToegevoegd
506,100000040,5,nl.kadaster.koers.dossier.events.persoon.NatuurlijkPersoonGegevensToegevoegd
507,100000040,6,nl.kadaster.koers.dossier.events.adres.ObjectLocatieBinnenlandToegevoegd
New axon saga configuration :
@Bean
public SagaStore sagaStore(@Qualifier("eventSerializer") Serializer eventSerializer, Cache sagaCache, DataSource kwrDataSource) {
//use jaxb serializer for sagas
return CachingSagaStore
.builder()
.associationsCache(sagaCache)
.sagaCache(sagaCache)
.delegateSagaStore(JdbcSagaStore.builder().serializer(eventSerializer).dataSource(kwrDataSource).build())
.build();
}
@Bean
public ConnectionProvider connectionProvider(DataSource dataSource) {
return new UnitOfWorkAwareConnectionProviderWrapper(new SpringDataSourceConnectionProvider(dataSource));
}
@Bean
public TokenStore tokenStore(ConnectionProvider connectionProvider) {
return JdbcTokenStore.builder().connectionProvider(connectionProvider).serializer(JacksonSerializer.builder().build()).build();
}
//caching saga's
@Bean
public Cache sagaCache() {
return new EhCacheAdapter(cacheManager().getCache(SAGA_CACHE));
}
@Bean
public CacheManager cacheManager() {
return CacheManager.newInstance(getClass().getResource("/ehcache.xml"));
}
Part of existing configuration :
@Bean
public DataSourceTransactionManager getTransactionManager() {
return new DataSourceTransactionManager(dataSource);
}