exclude sagas during replay

117 views
Skip to first unread message

Danny Kruitbosch

unread,
Oct 18, 2018, 11:32:35 AM10/18/18
to Axon Framework Users
Hi,

I am looking into replay for our application. We use sagas for syncing with a legacy backend (through soap services).
Now I am starting to look into replay of events (for now just to rebuild the current state of the application, no upcasting of events yet)

What I did is the following

I clean my "view" datastore and also reset all tracking tokens in my axon store (we're using MongoDB, soon to be AxonServer ;))
Next I restarted my application, and I saw all webservice requests being issued again. And I also saw "new" events being created in the event store.

So I looked into the docs and found that you can set @AllowReplay(false) on an EventHandler. Did that on all my @SagaEventHandlers and run the test again.
Still all my sagas were kicked off again (and hence all soap requests, also the one sending data to the legacy services which leads to all kinds of issues at the backend).

So how do I prevent sagas being triggered again during replay?
I there a way to exclude the saga from replay by setting it in the saga config?

If not, than how do I prevent replayed events from being send to the "outside" world again?

Thanks,

Danny

milan...@axoniq.io

unread,
Oct 19, 2018, 4:41:09 AM10/19/18
to Axon Framework Users
Hi Danny,

First of all, I'm really happy to hear you are transitioning to AxonServer ;). 

Since 3.2 we provided a Reset functionality for Tracking Event Processors (TEP). So, you don't have to manually clear tokens. As a matter of fact, this is the only way a TEP can know it's replaying events and not just doing a fresh start from the begging of the event stream. When using a Reset API, TEP will respect @AllowReplay annotations (do note that Sagas are by default not replayable - you don't have to configure anything special).

For details on how to use Reset API please refer to our Reference Guide.

Hope this helps!

Cheers,
Milan

milan...@axoniq.io

unread,
Oct 19, 2018, 5:06:22 AM10/19/18
to Axon Framework Users
Hi again :),

I forgot that we recently migrated our Reference Guide to the new domain. Here is the link pointing to the new domain.

Cheers,
Milan
Reply all
Reply to author
Forward
0 new messages