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
Event watcher should not quit upon errors/exceptions #161
Comments
bwaidelich
added a commit
to bwaidelich/Neos.EventSourcing
that referenced
this issue
Feb 28, 2018
This centralizes the invokation of `when*()` event handlers to a central class that ensures the following invokation order: # `beforeInvokingEventListenerMethod()` (when implementing `ActsBeforeInvokingEventListenerMethodsInterface`) # `when*()` (the actual event handler) # `saveHighestAppliedSequenceNumber()` (when implementing `AsynchronousEventListenerInterface`) # `afterInvokingEventListenerMethod()` (when implementing `ActsAfterInvokingEventListenerMethodsInterface`) This allows EventListeners to wrap the event handling in transactions for example: ``` class SomeEventListener implements AsynchronousEventListenerInterface, ActsBeforeInvokingEventListenerMethodsInterface, ActsAfterInvokingEventListenerMethodsInterface { public function beforeInvokingEventListenerMethod(EventInterface $event): void { // start transaction } public function whenSomeEvent(SomeEvent $event): void { // db interaction } public function saveHighestAppliedSequenceNumber(int $sequenceNumber): void { // update sequence number in db } public function afterInvokingEventListenerMethod(EventInterface $event): void { // commit transaction } } ``` This change... * Renames `EventListenerLocator` to `EventListenerManager` – the class is now also responsible for *invoking* event listeners * Removes `EventPublisher::catchUp()` and moves the remaining logic to the `EventCommandController` * Introduces an `ActsAfterInvokingEventListenerMethodsInterface` marker interface, that is used similarily to `ActsBeforeInvokingEventListenerMethodsInterface` and allows to wrap event handling in a transaction * Introduces a new `EventCantBeAppliedException` that allows for easier handling of exceptions during event handling (see neos#161) * Removes an unused `projectionCache` configuration Related: neos#159
Duplicate of #208 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, if the
event:watch
command encounters an exception it just stops.In order to stabilize the event handling we should consider a more resilient implementation.
For example: The worker could re-try to apply events and/or skip failed ones somehow
The text was updated successfully, but these errors were encountered: