-
Notifications
You must be signed in to change notification settings - Fork 10
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 stream handling enhancements #445
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #445 +/- ##
==========================================
+ Coverage 88.91% 89.03% +0.12%
==========================================
Files 71 71
Lines 5981 6039 +58
Branches 1187 1212 +25
==========================================
+ Hits 5318 5377 +59
Misses 492 492
+ Partials 171 170 -1 ☔ View full report in Codecov by Sentry. |
This is done on registration because `domain.name` is a part of the event type string. Ex. `Customer.Registered.v1`.
We were basing the logic on retrieving handlers on the fully qualified name of the event or command class. This commit moves the logic to be on the `__type__` attribute of event/command classes. This is one of the steps necessary to be able to handle events/ messages from other systems, where we may not have an event registered in the domain. It is also necessary to be able to support multiple versions of event and command classes.
Factory methods in command handler and event handler were parsing the methods marked with `handle()` and setting up command and event structure for later processing. This has now been moved to `Domain.init()` method because events and commands are not yet ready when command and event handlers are registered.
Also, retain `stream_name` as the field in Message and Event store implementations. We will change this when we push message construction and processing to each event store's implementation.
- Do not allow associations and references in Events and Commands - Use camelcase domain name when constructing event/command type - Validate ValueObject field is connected to a value object - Refactor repository methods to indicate support for both aggregates and views
Use the `__type__` value present in events and commands to retrieve event and command classes from domain, instead of fetching by fully qualified name. This change is required to support cross-domain event processing. Also: - Fix bug with collecting identity value in associations - Remove unused delist functionality in registry
This commit allows external events to be registered in a domain to allow processing incoming events. The event is only stored in a cache mapped by event types, and does not update the registry.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains changes to enable Event Handlers to operate on a stream and derive event class from the
type
in the event data.In the first iteration of Protean, event classes will need to be placed in a separate shared package accessible to the domain producing the event and all domains consuming the event. In later iterations, we will replace the shared event directory with a schema registry, and domains will be able to generate event classes from schemas.