JD.
JD.

Reputation: 15551

CQRS/EventStore: How are failures to deliver events handled?

Getting into CQRS and I understand that you have commands (app layer) and events (from the domain).

In the simple case where events are to update the read model, do read model updates fail? If there is no "bug" then I cannot see them failing and as I am using EventStore, I know there is a commit flag which will retry failures.

So my question is do I have to do anything in addition to EventStore to handle failures?

Coming from a world where you do everything in one transaction and now things are done separately is worrying me.

Upvotes: 1

Views: 1326

Answers (1)

Mikael Östberg
Mikael Östberg

Reputation: 17156

Of course there may be cases where a published event will fail in the read models.

You have to make sure you can detect that and solve it.

The nice thing is that you can replay all the events again and again so you have the chance not only to fix the error. You can also test the fix by replaying every single event if you want.

I use NServiceBus as my publishing mechanism which allows me to use an error queue. Using my other logging tools together with the error queue I can easily determine what happened since I have the error log and the actual message that caused the error in the first place.

Upvotes: 2

Related Questions