Default Tracking Token to head in case of Sagas
See original GitHub issueWhen a SagaConfigurer
will make the Saga instance use a TrackingEventProcessor
as the mechanism to receive events, it would be beneficial to make the initialTrackingToken
of that Processor start at the head.
The thought behind this is that if a new Saga is introduced into the stack, you’d typically want to start that at the point in time you introduce that logic. Hence, the TrackingToken
for the Tracking Processor of such a Saga should start at that point in time.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Saga Tracking Token always initialized with latest globalIndex
A Streaming Processor dedicated to a Saga will default the initial token to the head of the stream. The default initial token position ......
Read more >React and Redux Sagas Authentication App Tutorial, Part 3
Just gives a token back signed with it's secret and some contextual data. In this case, the token is both the proof of...
Read more >Starting a Saga conditionally · Issue #1900 - GitHub
We have configured a separate message source (set as the default) that reads all data back in and emits it to the event...
Read more >Axon Saga not getting created - Stack Overflow
I suspect the reason for this behaviour is that the token of the Saga Processor is already at the head of the event...
Read more >Confused about Configuration in Axon 4. - Google Groups
(I.e. setting the initial tracking token). Speaking of which we think the default should be the head token, not the tail. (A clean...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I might not have been overly clear with my response @muradm, but “Allowing to configure TrackingEventProcessorConfiguration on per saga/processing group” is actually possible at the moment. Figured that was clear from my response, but I guess I have jumped to many hops then.
Let me restate my solution in a full fledged sample, something I tried to avoid the previous time around:
Doing the above will ensure that whenever you start the
TrackingEventProcessor
(TEP) of your Saga for the first time, the token will be add the head of the stream. So there you are simply configuring the TEP used by yourMySampleSaga
to start it’sTrackingToken
at the head of the stream. Retrieving such a token is the job of theStreamableMessageSource
you are using, which typically defaults to theEventStore
implementation used in your application.Trusting this helps you out further @muradm.
We’ve actually quite recently introduce a dedicated samples repository just for that purpose. This repo will be further filled up as time progresses, likely searchable through a different portal as well. So, happy to hear you find it valuable, stay tuned for more to come 😃