I am using axon 4.2, single database (single saga store/event store/token store etc.)
We have 2 QA environments and I deployed the same code into both of them. I dynamically assigned different processing group names to Saga based on the environment, say one is QA1SagaProcessor and the other is QA2SagaProcessor for the same Saga Class. Now events get processed by both processors, which is using the same Saga class. My questions is: an event with a certain associationProperty value comes in, will there be two Saga instances at a single point of time, one from each processor in one environment? Or is there still only one Saga instance at a single point of time, from one environment, it finishes processing, serializes into Saga store, then another Saga instance from the other environment de-serializes and process the same event again?
From what I am observing, since the tracking processor names are different (thus different tracking token), there will be two Saga instances at the same time. I am not sure about when serialize/de-serialize will happen (seems to me it is unpredictable or is it done every time an events coming in?), the final value stored in Saga_entry table is also unpredictable depending on which instance serializes into table last. (We have other events coming in, one event is just a very simplified example)
Can Axon guru confirm if my observation is correct? I understand that if I just leave the processor name alone (so they are the same value, SagaProcessor, in both environments), then there will be only one Saga instance handling one event at a single point of time (A saga instance is never invoked concurrently by multiple threads. Therefore, a sequencing policy for a saga is irrelevant. Axon will ensure each saga instance receives the events it needs to process in the order they have been published on the event bus.) My dilemma is that I have a requirement that I must dictate a Saga instance from a specific environment to process an event based on a certain attribute on the event itself. I don’t know the algorithm how axon cluster pick a Saga instance. (How is the processor competing for token?)