You don’t necessarily have to stop the entire application. What would be mandatory though is to stop the
TrackingEventProcessor (TEP) from processing. More specifically every instance of your application should have that TEP stop working. This is a requirement as you need to change the tokens each of those instances use and a TEP threads will try to claim a token whenever they can.
FYI, to stop the TEP, you can invoke the
When it comes to actually splitting or merging the token…well you could have a look at the implementation if you want to have a full fledged solution like is part of more recent framework versions. Splitting would be most feasible to implement well I think, as you can simply insert a new token at the same location, with a different size to it. Merging is rather difficult though, as you will need to be aware that when you are merging there is zero guarantee the tokens you want to merge are at the same position. Hence, the merged token needs to keep track of both tokens, until they both reach the same point in the stream. Or, you would only allow a merge on tokens which have reached the head of the stream, that would solve it.
But, to be fair though, I would opt to moving to a more recent version of Axon Framework. It provides you all this out of the box, as well as a tremendous amount of other recent features you can tap into.
That’s my 2 cents to the situation, hope it helps you out @Karl_Muscat.