Hi all.
We are in a place where we need to “migrate” all our existing events into a new structure, and trigger new Commands based on state in previous events. This will result in new aggregates being created and updated. We are doing this by attaching a MigratingEventListener (fancy name…) to event playback and running this over all events.
We were thinking to add the original event identifier as metadata to the new events as a source for provenance-information, but I cannot find a way to get hold of the original identifier, using:
@EventHandler
public void on(final ArchivalRecordLocallyDescribedEvent event, EventMessage msg, MetaData m) {
String id = msg.getIdentifier();
}
However, the ID i get from this function is a new identifier, not the original. MetaData only contains the metadata (from the metadata column) of the original event, and in most cases is empty (as we have no metadata for most of our events).
Is there some way I can get hold of the original event identifier that I haven't seen yet?
Any help would be much appreciated :)
Thanks,
Trond Marius