question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resetting TrackingEventProcessor works differently if event-store is empty

See original GitHub issue

Basic 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:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
smcvbcommented, May 20, 2021

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!

0reactions
smcvbcommented, May 20, 2021

Closing this issue as it has been resolved in pull request #1802

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found