Hi Axon users,
I got involved in an old project that uses Axon 2. We now want to migrate it to Axon 4.
The project has a functionality that replays all events for a certain aggregate with a certain identifier. With Axon 2 was it like this:
`
public void replayEventsForAggregate(final String aggregateIdentifier,ReplayingCluster replayCluster){
final Criteria criteria = getCriteriaThatListAllEventsForAggregate(aggregateIdentifier,replayCluster);
replayCluster.startReplay(criteria);
}
private Criteria getCriteriaThatListAllEventsForAggregate(final String aggregateIdentifier,
final ReplayingCluster replayCluster) {
return replayCluster.newCriteriaBuilder()
.property(aggregateIdentifierFieldName).is(aggregateIdentifier);
}
`
I understand we in Axon can replay events using TrackingEventProcessor and use ProcessingGroup to only trigger certain aggregate.
But are there any similar way to set criteria for the events like above (see newCriteriaBuilder)?
Does Axon have a best practice on this?
Thanks in advance for your help.
Regards,
Theis