From the documentation and the discussions, I understood the following: When I have different instances of the app and then I call the resetToken method in one of them, the process is going to fail if the subscriber does not own all the tokens, but it will succeed if it owns everything.
- Is that the right assumption?
- For the same processor in different instances, could different instances hold different tokens, preventing me from resetting in all of them?
I do not mind issuing the call in different instances and failing in every one but one, but scaling down is not an option.
Any suggestions?
Axon Version: 4.13
Just to clarify here - lets say we have 2 pods/nodes of the same service. Both nodes will have an instance of TrackingEventProcessor running for the processing group. Only one of them will have the lock on the tracking token and thereby process events. This is completely fine and as expected.
According to your documentation here it is emphasized that the event processor must be shut down completely, before triggering the resetTokens() command.
But, when in a multinode setup - the request to reset tokens is processed in one of the nodes, meaning that the event processor in the other node is not aware that this is happening, and the event processor is not shut down in the other node.
I guess, that can cause conflicts and undefined behavior, if the other node has the lock on the token and it is not shot down before the resetTokens() call.
Do you have an solution to this problem build into axon (4.13 local event store), or are we on our own here? Somehow, we need to ensure that the event processor is shut down on all nodes before executing the resetTokens.
Thanks!
Hi,
as pointed out in the warning-box a bit below (right after the code sample) in the 4.13 documentation on programmatic streaming event processor resets, in multi-node environments it’s required to shut down the processor on all nodes to avoid this type of conflicts. You can do that either using Axoniq Platform, the Axon Server Dashboard, or a custom endpoint in your application that ensures shutdown of the processor on all nodes.
I hope this clarifies your question.
Best Regards,
Jakob