Axon framework example with Hibernate but without Spring


is there a working example of Axon framework, that uses JPA to store events/snapshots/tokens in DB, but does not require usage of Spring or similar dependencies?


Hi Tomáš,

There are two example applications on the Axon Framework repository, the Axon Bank and Axon Trader application.

Both however use Spring (as you might have already seen).

Thus, Axon Framework it self doesn’t contain any example applications of what you seek.

That said, I think it should be relatively simple to create, and added you can of course always ask question in thus user group how to solve specific issues you encounter.

Maybe somebody else has an example application laying around which they want to share though. I’m however not aware of any.



Hi Steven,

yes i’ve seen those two examples.
But i’m struggling to get it working besides storing and reading events…i.e. snapshotting, replays, because these use multithreading and that seems to be the problem, atleast for me.

Thats why i was curious to see how i should implement transaction manager, entity manager provider and tracking processor config etc.

Best regards,

Hi Tomas,

if you’re using the Configuration API (which is recommended), you can find methods on the AggregateConfigurer to configure snapshotting. It expects a “SnapshotTriggerDefinition”, which basically tells Axon when a snapshot should be created. You can use the “EventCountSnapshotTriggerDefinition” to create a snapshot after X events, or implement your own.

You can configure a TransactionManager and most of the other components on the main configuration (using the Configurer).

Hope this helps.