Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Project or ApplyEvent functions is not handled later on #250

Open
berk-can opened this issue Sep 19, 2019 · 5 comments
Open

Error in Project or ApplyEvent functions is not handled later on #250

berk-can opened this issue Sep 19, 2019 · 5 comments
Labels

Comments

@berk-can
Copy link

Hello there,
I want to know about how error handling is planned for error returning from Project or ApplyEvent function?

Both of them neither rollback saved command nor reprocess after some time passed or service is restarted?

What I want to achieve is:

I want to update another SQL table on every change made to readside, but I want to also handle errors that might happen while trying to save SQL table; worst scenario I should be able to rollback saved command, best scenario I want eventhorizon handler to try to Project or/and ApplyEvent again after some time if some flag (lets say eh.retryFailedEvent(true) ) is set

@maxekman
Copy link
Member

maxekman commented Oct 24, 2019

Correct, proper and robust error handling is lacking in some parts of the toolkit. Do you have any code changes to suggest for how to do this cleanly in EH?

(And sorry for the late reply..)

@berk-can
Copy link
Author

As far as I could think,
Events should have flag to check if they are correctly projected to readside, and that flag is updated whenever that event correctly projected to readside.
This way whenever EH is iterating old events it can see if an event failed to be projected to readside before next events are tried to be projected, also user can configure EH to check or even get errors and stop projecting events when there is faulty event in queue

I used Lagom (Microservice CQRS framework for Java/Scala) for last year and whenever some event are not projected we were getting error regarding projector is lagging behind and we couldnt project any new events, so we were forced to fix errors and then process events afterwards

@jaypee-f
Copy link

jaypee-f commented Apr 24, 2020

If a projector fails to apply an event to it’s projection. Put it in a DLQ. Next event or after timeout (for that aggregate) try to resend? This is only for projections? It’s the projectors problem solely?

@maxekman
Copy link
Member

maxekman commented Apr 24, 2020

Regarding the flag on events, I don’t think it’s feasible. Events can be projected by multiple projectors and in principle the events shouldn’t care or know about who uses them, only that they are safely stored. If projections needs to be made up to date by re-projecting possible missed events they should be able to handle that themselves, and also be idempotent for old events.

@maxekman maxekman added the bug label Dec 11, 2020
@maxekman
Copy link
Member

maxekman commented Jan 8, 2021

When the retryable event error is implemented it can be used with projectors to signal if another try should be done or not. See: #279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants