Resetting TrackingEventProcessor works differently if event-store is empty
See original GitHub issueBasic information
- Axon Framework version: 4.4.3 (also tried 4.5)
- JDK version: openjdk version “11.0.3” 2019-04-16 LTS
Steps to reproduce
@RestController
@ProcessingGroup("migrator")
public class Migrator {
@Autowired
private EventStorageEngine ese;
@EventHandler
public void on(Event e) {
}
@Autowired
private AxonConfiguration configuration;
@GetMapping("/migrate")
public void migrate() {
configuration.eventProcessingConfiguration()
.eventProcessorByProcessingGroup("migrator", TrackingEventProcessor.class)
.ifPresent(tep -> {
tep.shutDown();
});
ese.appendEvents(...); // add some 'Event'-events
configuration.eventProcessingConfiguration()
.eventProcessorByProcessingGroup("migrator", TrackingEventProcessor.class)
.ifPresent(tep -> {
TrackingToken ht = tep.getMessageSource().createHeadToken();
tep.resetTokens(ht);
tep.start();
});
}
}
I have this RestController in my application. The application starts with an empty database. The idea is to halt processing, insert new events and then resume processing but skipping everything that was just added. It does not work like I expected the first time I run this though. The first time around the EventHandler is called for each of the new events. Subsequent calls to /migrate don’t do this and the events are skipped.
Expected behaviour
EventHandler is never called.
Actual behaviour
EventHandler is called for each event the first time /migrate is called (when Event-Store is empty), but not on subsequent calls.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Events from AxonDB eventstore do not arrive in my ...
Reading the events seems to work, confirmed by to the AxonDBEventStore logging. But after this, the EventBuffer stays empty, so my processor ...
Read more >Tracking Processor fails after application restart. Token owner ...
I am noticing a weird behavior, where everytime I restart the application the token owner becomes null. And after that no event is...
Read more >Demystifying Tracking Event Processors in Axon Framework
A Tracking Token represents the position of an event in the event stream. Different Event Store implementations may use different implementations of the ......
Read more >Maintenance | EventStoreDB Documentation
When you delete events or streams in EventStoreDB, they aren't removed immediately. ... Restart scavenging If you need to restart a stopped scavenge, ......
Read more >reference-guide/streaming.md at master · AxonIQ ... - GitHub
As the Event Store is a type of StreamableMessageSource , the default will switch to the Tracking Event Processor. If the application only...
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 Free
Top 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
I just wanted to let you know @michaelbub that the fix described in pull request #1802 has just been released under 4.5.1. It should be available for download soon!
Closing this issue as it has been resolved in pull request #1802