Adding new filed to DomainEventEntry entity.

Please let me know how to add and additional field to DomainEventEntry entity.

Please let know which class is better to used to extend or any other approach.

Hi Sudhendu,

I’d say introducing a your-project-specific implementation of the DomainEventEntry would be fine if you want to add another field to it.

Do not forgot to also introduce your own EventStorageEngine in this situation though.

If you’re for example using the JpaEventStorageEngine, you’ll have to extend from that class and override the createEventEntity(EventMessage, Serializer) function, as otherwise Axon will still create a DomainEventEntry to be stored.

If in your case you’re using the JdbcEventStorageEngine, you’ll have to override the appendEvents(List<? extends EventMessage>, Serializer) function to specify the entity you’re storing.

Hope this helps you out Sudhendu.

Cheers,

Steven

Thanks Steven for the quick response,

Please let know what the class name if i am using axon2.

Hi Sudhendu,

In Axon 2.4.x, that would mean adjusting the following for the given examples:

  • Still the DomainEventEntry for an added column
  • If using JPA, the JpaEventStore, where you’d only override the appendEvents(String type, DomainEventStream events) function to coop with your private DomainEventEntry.
  • If using JDBC, the JdbcEventStore, where you’d only override the appendEvents(String type, DomainEventStream events) function to coop with your private DomainEventEntry.

Hope this helps.

Cheers,

Steven