Replaying events after using the subscribing event processors

We started using Axon in production a year ago. Since the beginning we used the subscribing event processors.
Now we have the requirement to replay all events and rebuild our model in the database.

I realized that registering a tracking event processor together with

EventProcessingConfigurer.usingSubscribingEventProcessors();

is possible.

However, since we are using the processing groups it seems I need to specify an extact processing group when registering the tracking event processor.
In this way I create tracking event processors for each processing group that I could replay.

However, I want to replay all events in exact order in a single thread and not by processing group. Thus, I wanna have a single tracking event processor to use for replaying all events one by one.

Is there any way to do this?

Would removing the @ProjecttionGroup from all listeners work in this case? Would then the @Order directives be respected?

Any help would be highly appriciated.

Thanks in advance,
Ivan

Hi Ivan,

If all Event Handling Components are grouped under the same ProcessingGroup, thus the same Event Processor, the @Order annotation will be respected indeed.
Note though that in the absence of the @ProcessingGroup annotation, the package name will be used as the processing group for your event handlers.
Thus simply removing the annotation does not immediately mean all event handlers are grouped under the same processor.
It would be safer to put all event handlers in the same processing group prior to switching to TrackingEventProcessor.
Granted, this is the route you really want to take…let me specify that further too.

The word of caution I want to give, as an assumption I am making on your request that everything should be handled in order.
I am assuming an @Order annotation you have placed on the entire Event Handling classes here, right?
In that case, I would recommend trying to unweave your Event Handling Components from one another (at least eventually).
Using the @Order annotation for all Event Handling Components is essentially tying everything together with one another, creating massive portions of works.

Especially when it comes to replaying, you typically just rebuild one or two query models, not all of them.
If however all your handlers are intertwined with one another through the @Order annotation, you would have to replay all models at every occasion a rebuild is required.
This will mean rather massive performance impacts on replaying your application, as it’s just a lot of work which needs to be done.
Granted, I am no expert on your domain and set up, so I may be making wrong assumptions here.
But I felt a word of caution was definitely in order here.

Hoping this helps you further Ivan!

Cheers,
Steven

PS. It is important to note that this mailing list will be discontinued as specified in this thread.
The thread also specifies where to look further for help when it comes to Axon.