Event sourced aggregate and backed up event handler

Event sourced aggregate stores the event steam and publish the event. The consumer subscribs the event and updates the read side db asynchronously. But how could I handle if the event handler backed up?

For example, when a user enrolls in a course, we need to display all enrolled courses in the list. If Axon server and event handler is backed up, there will be a delay to update the read side db and user can't see the course which they enolled right before.

Any advice? Thanks.

Hi Brian,

Would you mind sharing what your set up is?

So, which version of Axon are you using?

And, are you using Axon Server together with it, or have you decided to use the ‘Axon Framework’-only solution?

The SimpleEventBus indeed is as you’ve read only a mechanism to get an event from one side to another.
It is thus not in charge of recalling which events it has send over the wire, at all.
If you’d want to have a persistent mechanism of publishing and handling events, I’d strongly recommend to use Axon Server or a JPA/JDBC backed EmbeddedEventStore in your application.

Additionally, based on your ‘event handler sends an email’ example, I’d like to suggest to have Event Handling Components which act as notification mechanism (e.g. sending emails) to be separated from the regular operating mode of your application.
Thus, a separate thread, dealing with handling the event and sending an email, is beneficial in this scenario.
Note that for this to work separately from the rest of your application, you will have to use a Tracking Event Processor.
Additionally, a Tracking Event Processor requires a persistent event storage mechanism, not just a regular EventBus.

If the above does not give you enough insights, I assume you answering my earlier questions will get us to a point we can help you out Brian!

Cheers,
Steven