I see you’re calling the
EventBus#publish(Object) function yourself.
From an Axon perspective, you’re then not publishing an event from a domain object, but from a regular component.
Due to that, Axon regards it as an EventMessage instead of a DomainEventMessage.
As it stands, only DomainEventMessages set the
aggregateIdentifier column as the actual Aggregate identifier.
When it’s a regular EventMessage, the
aggregateIdentifier is the same value as the
You could thus verify if what I am stating there is true, which thus points out why the aggregate identifier isn’t as you’ve expected it.
If you want to store Domain Event Messages, the event should be published from the lifecycle of an Aggregate.
To do that, you should be in the scope of an Aggregate and use the
Hope this helps you out Michael!