How to configure and trigger a replay of events using the ReplayingCluster

Hello everyone,

As part of our migration from Axon 1.4 to Axon 2.4.2 we’d also like to deprecate our homegrown replaying mechanism in favour of the build-in ReplayingCluster.

Unfortunately, in the documentation we cannot find any concrete example on how to setup or trigger a replay of events using the ReplayingCluster. Also, searching in this forum didn’t yield any results.

Can somebody share some code examples or share some of the hints?

Thanks,
Yannis

Hi Yannis,

if you have configured replaying on a cluster (either by wrapping a cluster in a ReplayingCluster or by specifying replay properties in the Spring XML config), you can invoke startReplay on that cluster. Optionally, you can provide an Executor instance that should perform the replay, if you want it done asynchronously. The future returned can be used to detect when the replay has finished.

If you need to trigger a replay from outside your application, you must provide your own mechanism that invokes the startReplay method (through JMX, API, UI, etc).

Cheers,

Allard

Hi Allard,

Thanks for the reply. We are slowly but steadily find our way with the Axon framework 2.x.

It has many nice features (ClusteringEventBus, ReplayingCluster, etc) which make it a lot easier for us. It can be a lot of work to upgrade but the result will be worth it.

Thanks again for your efforts!

Cheers,
Yannis