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.

ReplayStatus always false and @DisallowReplay not working for PooledStreamingEventProcessor

See original GitHub issue

Basic information

Steps to reproduce

  1. Start giftcard-demo modified in repo above
  2. Issue single card and redeem card (2 events)
  3. Initiate replay by pressing “Submit Bulk issue cards”

Expected behaviour

The expected behaviour is how the TrackingEventProcessor (axon.eventhandling.processors.card-summary.mode=tracking) works:

2022-03-25 11:37:17.268  INFO 24840 --- [nio-8080-exec-7] o.a.e.TrackingEventProcessor             : Shutdown state set for Processor 'card-summary'.
2022-03-25 11:37:17.269  INFO 24840 --- [nio-8080-exec-7] o.a.e.TrackingEventProcessor             : Processor 'card-summary' awaiting termination...
2022-03-25 11:37:17.622  INFO 24840 --- [card-summary]-0] o.a.e.TrackingEventProcessor             : Released claim
2022-03-25 11:37:17.623  INFO 24840 --- [card-summary]-0] o.a.e.TrackingEventProcessor             : Worker for segment Segment[1/1] stopped.
2022-03-25 11:37:17.651  INFO 24840 --- [card-summary]-1] o.a.e.TrackingEventProcessor             : Released claim
2022-03-25 11:37:17.651  INFO 24840 --- [card-summary]-1] o.a.e.TrackingEventProcessor             : Worker for segment Segment[0/1] stopped.
2022-03-25 11:37:17.665  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Worker assigned to segment Segment[0/1] for processing
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Dispatching new tracking segment worker: TrackingSegmentWorker{processor=card-summary, segment=Segment[0/1]}
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Worker assigned to segment Segment[1/1] for processing
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-3] o.a.e.TrackingEventProcessor             : Fetched token: ReplayToken{currentToken=null, tokenAtReset=IndexTrackingToken{globalIndex=1}} for segment: Segment[0/1]
2022-03-25 11:37:17.666  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Using current Thread for last segment worker: TrackingSegmentWorker{processor=card-summary, segment=Segment[1/1]}
2022-03-25 11:37:17.667  INFO 24840 --- [card-summary]-2] o.a.e.TrackingEventProcessor             : Fetched token: ReplayToken{currentToken=null, tokenAtReset=IndexTrackingToken{globalIndex=1}} for segment: Segment[1/1]
2022-03-25 11:37:17.678  INFO 24840 --- [card-summary]-3] o.a.m.interceptors.LoggingInterceptor    : Incoming message: [CardIssuedEvent]
2022-03-25 11:37:17.679 DEBUG 24840 --- [card-summary]-3] i.a.d.g.query.CardSummaryProjection      : class io.axoniq.demo.giftcard.api.CardIssuedEvent handler called with replayStatus=REPLAY

Actual behaviour

Performing the same steps with PooledStreamingEventProcessor(axon.eventhandling.processors.card-summary.mode=pooled):

2022-03-25 11:38:51.969  INFO 24872 --- [nio-8080-exec-3] o.a.e.p.PooledStreamingEventProcessor    : Stopping processor [card-summary]
2022-03-25 11:38:51.985  INFO 24872 --- [nio-8080-exec-3] o.a.e.p.PooledStreamingEventProcessor    : Starting PooledStreamingEventProcessor [card-summary].
2022-03-25 11:38:51.986  INFO 24872 --- [card-summary]-0] o.a.eventhandling.pooled.Coordinator     : Processor [card-summary] claimed 2 new segments for processing
2022-03-25 11:38:51.994  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : Incoming message: [CardIssuedEvent]
2022-03-25 11:38:51.995 DEBUG 24872 --- [card-summary]-1] i.a.d.g.query.CardSummaryProjection      : class io.axoniq.demo.giftcard.api.CardIssuedEvent handler called with replayStatus=REGULAR
2022-03-25 11:38:51.995  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : [CardIssuedEvent] executed successfully with a [null] return value
2022-03-25 11:38:51.996  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : Dispatched messages: [CountChangedUpdate]
2022-03-25 11:38:52.001  INFO 24872 --- [card-summary]-1] o.a.m.interceptors.LoggingInterceptor    : Incoming message: [CardRedeemedEvent]
2022-03-25 11:38:52.002 DEBUG 24872 --- [card-summary]-1] i.a.d.g.query.CardSummaryProjection      : class io.axoniq.demo.giftcard.api.CardRedeemedEvent with @DisallowReplay handler called

The problematic part is the CardIssuedEvent handler called with replayStatus=REGULAR and the CardRedeemedEvent called although it has the @DisallowReplay annotation and a replay was performed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Morlackcommented, Mar 28, 2022

Hello @oysteing , thanks for reporting the issue with us! I have investigated and the ReplayToken is not properly propagated to the messages in the UnitOfWork when using a PooledStreamingEventProcessor. We are working on fix, which will be released in 4.5.9.

0reactions
smcvbcommented, Mar 30, 2022

The BOM’s been released, @oysteing. It might take a little bit to get available, though. I’m sure it’ll be present tomorrow, though. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event handler replays when restarting app? - Stack Overflow
I am playing around with axon server locally. I am running a docker container on my local machine via the command ...
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