title: Axon framework retry logic
body: <p>i am trying to use the <code>eventProcessingModule</code> in Axon 4.1+ to do a replay events on a 2 JVM node K8 cluster. while i have it setup that it will clean up events it only picks it up from one of the nodes and the other keeps running since its tracking event is still live. </p>
  
  <p>how do i go about getting it to be disabled across all the JVMs at the same time so it can properly replay? then get enabled on all of them to continue handling the commands. </p>
  
  <p>i have tried upping the threads via this code, which leads to another issue that existing tokens never increase in the InitialSemgmentsCount unless i completely delete the token from the DB. </p>
  
  <pre class="lang-java prettyprint-override"><code>    public void config(final EventProcessingConfigurer configurer) {
          configurer.registerTrackingEventProcessorConfiguration(c -&gt;
                  TrackingEventProcessorConfiguration
                          .forParallelProcessing(2)
                          .andInitialSegmentsCount(2));
          // .andTokenClaimInterval(10L, TimeUnit.SECONDS)); // Event
      }
  </code></pre>
  
  <p>My Current setup:</p>
  
  <pre><code># Application.yml
  axon:
    distributed:
      enabled: true
  
  </code></pre>
  
  <p>a Service component with the following:</p>
  
  <p>autowired in <code>EventProcessingConfiguration eventProcessingModule</code> </p>
  
  <pre class="lang-java prettyprint-override"><code>eventProcessingModule
          .eventProcessorByProcessingGroup("query.skuProcessor.SkuProjection", TrackingEventProcessor.class)
          .ifPresent(trackingEventProcessor -&gt; {
              trackingEventProcessor.shutDown();
              trackingEventProcessor.resetTokens();
          });
  
  // Thread.sleep() to verify with
  
  eventProcessingModule
          .eventProcessorByProcessingGroup("query.skuProcessor.SkuProjection", TrackingEventProcessor.class)
          .ifPresent(trackingEventProcessor -&gt; {
              trackingEventProcessor.start();
          });
  </code></pre>
  
  <p>the sample code had the above in a single shutDown/reset/start setup but i split them just to see how it is working (believe the @ResetHandler is called after the Reset thus the Start waits, but not fully sure)</p>
  
  <p>SkuProjection component with a <code>@ResetHandler</code> void method to clean up the table to be replayed. </p>
  
  <p>depending on which JVM currently has the token, the other will return this error: 
  <code>SkuReplayService.startReplay: Failed on exception! Unable to claim token 'query.skuProcessor.SkuProjection[0]'. It is owned by '1@sku-7694bbc6b6-8p958'</code></p>
  
  <p>i would think the <code>token_entry</code> table would go to "null" for owner while its "stopped" but since there are 2 JVMs the one that currently doesn't have the token will take it over while the other replays. Confirmed that the 2nd node is running with the Token after the first node stops its processor.</p>