How to set initial tracking token for newly added Saga?

Hi there,

we are currently facing the following issue:

We have added a new Saga to our code. Now, the TrackingEventProcessor for this new Saga is created with the tracking token “-1” which makes sense since there is not entry in the JpaTokenStore for this newly added Saga.

But we don’t want the new Saga to process all of the existing events from the very beginning. We only want it to process new events. So I’d like to set the initial tracking token for this Saga / TrackingEventProcessor to the head of the stream.

I’m unable to figure out how to achive this :confused: I’ve played around with stuff like TrackingEventProcessorConfiguration, EventProcessingConfigurer, etc. But I just can’t figure it out.

Any hints in the right direction are much appreciated :smiley:

Martin

Hi Martin,

You can add the following configuration:

@Configuration
public class TrackingProcessorAxonConfig {
    @Autowired
    public void configureTrackingEventProcessors(EventProcessingConfigurer configurer) {
        // List of all the processing groups you have in your application
        List<String> processingGroups = new ArrayList<>();
        processingGroups.add("myGroup1");

Hey,

thanks!

I don’t think that we are actually using processing groups. We are using Spring Boot (auto configuration) and just annotate our Sagas with @Saga and let Spring Boot do the rest. So I don’t think we are using processing groups (or the default one that will be generated for us :thinking:?).

The name of one of the new sagas is “ResetPasswordSaga” and the processor is named “ResetPasswordSagaProcessor”. Is this the “name” that I have to put in the “name” field instead of the the processing group? Or does the “name” parameter always refer to a processing group? If so, how do I set a processing group name to a saga?

Martin

Found the answer :smiley: You can just use the name of the actual processor (in our case “ResetPasswordSagaProcessor”).