Axon 3 Custom Event Store using Springboot starter


I’m using axon-spring-boot-starter 3.2 dependency and using JPA Storage engine in my project. Currently, my events are getting stored in DOMAIN_EVENT_ENTRY table. I want to customize this table e.g change its name and add few extra fields.

Can anyone please let me know how to do that in case of axon 3.

Thanks and Regards,
Soumik Sarkar


you can customize the JPAEventStorageEngine. Override the domainEventEntryEntityName() and createEventEntity() methods to create your own entities. This entities will need to have the same properties as the one described by Axon, so most likely you’d want to extend the DomainEventEntry entity to add new fields.
Another option, is to change the mapping using an orm.xml file, which explicitly overrides the table name. Adding extra fields to the table isn’t a problem. Axon happily ignores those.

Hope this helps.

Thanks a lot Allard