We are using Axon Framework 4.7.3 and AxonServer 2023.1.0 in SE mode with SpringBoot 3.1.0.
We are using default configuration of eventbus,commandbus and EventStore.
We are using PooledStreamingEventProcessor. Also we are using JpaTokenStore.
Cosidering we are using Axon Server in SE mode, we are doing mannual backups of event stream segments and controlDB.
We are calling below APIS periodically.
curl --request POST --url http://localhost:8024/v1/backup/createControlDbBackup
curl --request GET --url 'http://localhost:8024/v1/backup/eventstore?type=EVENT
After ever API execution, we are copying over below files to a secure location:
To recover from axon event store failures we intend to use above back up files as below:
- Take a fresh axon server zip and create a data folder inside the same.
- Place these above 2 files under the data folder.
- Start the axon server and connect to it from SpringBoot app.
This approach is working for us to recover if there were no new events persited in event store in old set up after calling the above back up APIs.
In this case, we can see that in recovered setup the tokens are initialized to head and any new events persited from recovered setup to event store are getting processed fine.
We believe this is because the eventStore and JpaTokenStore was in sync.
But in case there is even one event newly persited in old setup after the back APIs were called, the event processer in new setup is not processing any new events persited in event store.
Will conguring EventProcessor to use HeadToken as initial token will solve this problem?
Cosideting we are using PooledStreamingEventProcessor, does below snippet correct to achive this?
EventProcessingConfigurer.PooledStreamingProcessorConfiguration psepConfig =
(config, builder) → builder.initialToken(messageSource → messageSource.createHeadToken());
configurer.registerPooledStreamingEventProcessor("ProjectionsGroup", (Function<Configuration, StreamableMessageSource<TrackedEventMessage<?>>>) psepConfig);