I’m about switching from event sourcing to JPA based state storage of the aggregates. As everything is now stored in the jpa tables I wanted to turn off event sourcing.
Unfortunately the JpaAutoConfiguration tiggers the creation of an EventStorageEngine. Later on this leads to an issue when the event bus supplies the event to the created event storage engine which tries to store the event in the database.
So my question how can I turn off the creation of the event storage subsystem.
if you annotate your aggregates with Jpa’s @Entity, Axon will automatically configure state-stored aggregates for you. No additional configuration is necessary. Alternatively, you can configure a specific Repository implementation for your Aggregate. Axon will use that repository instead of configuring (probably event sourcing) one for you.
seems you are right. The @ConditionalOnMissingBean should also include an EventBus, which would allow you to skip the configuration of a StorageEngine when there is an EventBus configured already.