A few days ago a client mentioned us an entity couldn’t be found, although our system returned a 202, meaning the request was processed successfully.
The request was processed successfully as events caused by the command due to the request can be found in the EventStore.
What’s so weird about this issue is all the tracking processors were not invoked on the events caused by the first request.
On subsequent events the tracking processors were throwing exceptions as the entity couldn’t be found in the database.
So the eventhandlers for the events from the first command were not invoked, but for subsequent commands, events were invoked.
What could have been possibly gone wrong with the events from the first command, as the tracking processors were not invoked?
Our setup is running 2 axon instances connected to 1 PostgreSQL database.
The processors are backed by JPA and JDBC repositories.
We also have an interceptor for handling events to be able to do more research on this issue.
The interceptor logs when an event is handled, but also in the logs no evidence the eventhandler was invoked.
Below a simplified snapshot of the events in the EventStore:
payload_type | timestamp | aggregate_id | sequence_number | my conclusions |
---|---|---|---|---|
Aggregate1CreatedEventDueToRequest1 | 2021-02-08T16:25:33.763048105Z | 1 | 0 | |
Aggregate2CreatedEventDueToRequest0 | 2021-02-08T17:12:28.036313918Z | 2 | 0 | Not handled by TPs |
Aggregate2Event2DueToRequest1 | 2021-02-08T17:12:28.036338611Z | 2 | 1 | Not handled by TPs, but handles by Subscribing Processor |
Aggregate2Event3DueToRequest1 | 2021-02-08T17:12:28.03635331Z | 2 | 2 | Not handled by TPs |
Aggregate2Event4DueToRequest1 | 2021-02-08T17:12:28.036372834Z | 2 | 3 | Not handled by TPs |
Aggregate1Event2DueToAggregate2Event2DueToRequest1 | 2021-02-08T17:12:28.045952574Z | 1 | 1 | |
Aggregate1Event3DueToAggregate2Event2DueToRequest1 | 2021-02-08T17:12:28.04599099Z | 1 | 2 | |
Aggregate1Event4DueToAggregate2Event2DueToRequest1 | 2021-02-08T17:12:28.04608497Z | 1 | 3 | |
Aggregate2Event5DueToRequest2 | 2021-02-08T17:12:28.058377074Z | 2 | 4 | Handled by TPs, but exceptions as previous events not handled |