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

Subscriptions could log errors to event store. #89

Open
alanbem opened this issue Dec 4, 2019 · 0 comments
Open

Subscriptions could log errors to event store. #89

alanbem opened this issue Dec 4, 2019 · 0 comments
Assignees

Comments

@alanbem
Copy link
Member

alanbem commented Dec 4, 2019

Subscription could catch exception that was thrown by underlying listener and $this->applyEvent(SubscriptionCaughtAnException($e->getMessage(), $version, $now)); and stop listening (until next run of its streak:subscription:run) and maybe even sleep for some number of seconds. It could be even configurable feature that can be turned on or off.

How about stopping subscription entirely after it caught an error and require manual intervention (maybe running streak:subscription:enable command?).
Again it could be configurable feature that can be turned on or off, so catching an error would not necessary stop subscription.
If subscription be configured to stop after error it could give support-team some time to investigate instead spamming event store with error event up until cause is fixed.

After fixing some massive outages there could be streak:subscriptions:enable (with required --force option because it would be easy to run streak:subscription:enable by mistake instead?) command that could find all subscriptions in error state and enable them back to work.
...or...
It could internally use pausing/unpausing mechanism proposed in #90

Next thing would be creating infrastructure listener that would send emails in case of an subscription error.


Remember to not check if listener is completed in case of caught error.

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

No branches or pull requests

1 participant