Comments (8)
Maybe skipping the event is not always a viable option depending on the domain. I guess that failing is a must in many scenarios. Maybe there is a bug that has to be fixed and skipping some events leads to inconsistent state.
from commanded.
@Papipo Skip event on error could be made configurable, either per event handler or globally.
from commanded.
Could use tarearbol to provide retry logic.
from commanded.
I see no need for this.
- Crash the app.
- App restarts as defined pre restart policy.
- Event gets delivered again.
- App may crash again. After erlang-defined crash semantics exceed the threshold the BEAM shuts down.
- Upper level machinery (e.g. docker) may restart the server.
This works great for my own cases (where I hand-built my process managers). Can't see why commanded would not succeed with this simple approach as well.
from commanded.
@drozzy, I think you talking about scenario when process manager generally fails (all process manager instances are failed), it's definitely should result app crash.
And I think proposal about - why crash the whole application if only one specific process manager instance fails? Just submit log, and stop executing bad process manager instance, or try another restart policy (like dropping state or skip event).
from commanded.
@drozzy Providing an extension point allows consumers of Commanded finer control over how they deal with errors on a case by case basis. So you could decide that for a certain event handler, or particular event, it should retry X times with exponential back-off between retries. Another handler could simply skip any problematic events. You could do this yourself inside an event handler, I'm proposing that Commanded provides a convenient interface for you to use.
I don't know exactly what the best strategy is for each use case, therefore make it user configurable.
from commanded.
Seems like this can be done with some external dependency in client code. Is there any actual use cases for this?
P.S.: I quite like Gregg's approach to features.
from commanded.
Closing this issue. Replaced by #93 to support error handling for process manager command dispatch only.
from commanded.
Related Issues (20)
- Process manager router option not working
- Lessons learned from performance optimization - an unlikely culprit HOT 3
- no function clause matching in Commanded.Commands.Dispatcher.telemetry_stop/3 HOT 1
- Docs questions
- Stacktrace in event handler error? HOT 2
- Paralelization Strategies in EventHandlers
- Should Commanded.Event.Handler support messages from swarm? HOT 2
- Event retention policies?
- please support multiple commanded application with one eventstore HOT 6
- Process Manager state serialization breaks when using a custom TypeProvider with the JsonSerializer
- `Commanded.ProcessManagers.ProcessManager.identity/0` function returns `nil` in unit tests
- no function clause matching in Commanded.Event.Handler.partition_event/4 HOT 1
- EventstoreDB is sunsetting the TCP protocol HOT 1
- Is it a bad practice for an event handler to depend on a projector completion? HOT 2
- Snapshotting 2 Aggregates having same identity
- Is it possible to log contents of InMemoryEventStore on failed test?
- Ecto Sandbox, Projections and In Memory adapter HOT 3
- Aggregate throws error when execute returns more than 1000 events.
- Individual stream events handling
- Skipped event with concurrency enabled HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from commanded.