Could not load segments for processor (TrackingEventProcessor, TokenStore, scheme, tutorials)


I have set up a basic example using aggregates, commands, events and a projection using axon-spring-boot-starter 4.1.1
It works, but I’m having difficulty to find proper documentation or tutorials to extend on it.

Every time I restart the server I see the events being replayed in my projection (backed by a persistent solr repository)
As a next step I would like to have more control in replaying events.
I would like a setup where by default the events, that were already processed, are not being replayed in that projection.
And I would like to do a REST request that rebuilds the solr repository from all events.

I have tried to read the Axon documentation, different blogs/articles and github examples, but it’s difficult to
combine all the snippets of information.

The Axon documentation states that by default Tracking Event Processors are used, which I think are the type that can track
the event offset. The offset must be persisted somehow, so I assumed that the TokenStore is somehow important in this.
I therefore created a JdcbTokenStore bean (postgres datasource).
When I start the application after that I receive the following warnings:

Fetch Segments for Processor ‘myquery’ failed: Could not load segments for processor [myquery].

I have not yet created any scheme in my postgres database. Is this message related to this?
I could not find any information if this is done automatically, or what steps I need to do for this.

I would appreciate any answer on the above questions or tips how I can become proficient using Axon.
The technology seems really cool, but the learning curve seems rather steep.

After debugging I indeed found out this was due to the database tables not being there.
I switched to JPA and let the tables being created automatically. Also added a JpaTransactionManager. After that the axon application started without errors, and use a TrackingToken at the correct index.

Hi Robert,

I am happy to find out you resolved the problem yourself and shared the issue you were dealing with.
From your description it immediately sounded like the Tracking Tokens weren’t being stored, which as you’ve noticed will lead to a complete replay every time.

Additionally, thanks for voicing your concern regarding the specifics on this.
I have some plans in mind to improve some of the reference guide sections.
I’ll make sure to include a very specific pointer that a persistent Token Store should be configured to ensure your application does not reply on every start up.