booster
booster copied to clipboard
Ignore events whose type is unknown
Feature Request
Description
When a new event is inserted in the Booster event store, the event dispatcher function is triggered in order to run entity reducers, read model projections, and event handlers. To do that, the event data, including the envelope object, is loaded from the database and type-casted to a class matching the type name described in the event metadata. If this class doesn't exist in the current Booster application, an exception will be raised.
There are many reasons why an application might find an unknown event:
- A Rocket or an external system integration has written an event to the event store database
- The event class has been deprecated and removed from the project but the events data remains and you're replaying old events
- The event store database is shared by multiple Booster apps (this is possible with custom-made providers in a microservices environment)
Possible Solution
Catch the exception and log the fact that the class wasn't found.
Additional information
Make sure to add unit and integration tests that prove the expected behavior for all supported cloud providers.