Hi,
We have put a replay mechanism in place that looks like this:
`
// ids is a List containing the AR ids to replay
ids.stream().forEach(id -> transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
JdbcCriteriaBuilder jdbcCriteriaBuilder = new JdbcCriteriaBuilder();
Criteria type = jdbcCriteriaBuilder.property(“TYPE”).is(“MyAR”)
.and(jdbcCriteriaBuilder.property(“AGGREGATEIDENTIFIER”).is(id));
replayingCluster.startReplay(type);
MyAR instance = inMemoryModelHandler.getProjectedInstance();
// write to db
update(instance);
// remove the snapshot so it gets reconstructed next time the AR is loaded
removeSnapshot(instance.getId());
}
}));
`
Basically a replaycluster replays to an eventhandler that reconstructs an in-memory model. When the replay is finished i persist the projection to the DB and also remove the corresponding AR snapshot. Then the transaction is committed.
What i am trying to figure out is how would this behave in a live instance when there are updates going on to the same AR we are trying to replay. Note that we have a distributed commandbus over jgroups with 2 nodes.
AFAICT the replaycluster is not using the distributed commandbus, it’s replaying locally on the node that processed the replay request. This means that its configured BacklogIncomingMessageHandler will also not receive any messages if they happen to be processed by the other node. Does this mean we would need to temporarily place the system in single-node config while doing the replay?
Thanks,
Jorg