Check projector active state using a specialized event publisher#474
Merged
erikrozendaal merged 4 commits intomasterfrom Jul 7, 2025
Merged
Check projector active state using a specialized event publisher#474erikrozendaal merged 4 commits intomasterfrom
erikrozendaal merged 4 commits intomasterfrom
Conversation
This simplifies the projector logic as all projector state tracking is now only checked by the `ActiveProjectorsEventPublisher`. Replay now uses the normal `EventPublisher` so the logic to determine if an event is allowed to be processed by a projector can be simplified.
Since the event publisher used for replay no longer requires reading the `projector_states` table within the same transaction as updating the projectors the transaction is no longer needed. Adding the transaction also causes problems with (potential) deadlocks, since projectors might update multiple rows inside the same transaction during replay using multiple parallel processes.
When using the active projectors publisher the check if a projector is active and publishing the events must be inside a single transaction to ensure consistency.
lvonk
reviewed
Jul 4, 2025
This file contains hidden or 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
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 simplifies the projector logic as all projector state tracking is now only checked by the
ActiveProjectorsEventPublisher. Replay now uses the normalEventPublisherso the logic to determine if an event is allowed to be processed by a projector can be simplified.enable_projector_statesflag and just require the user to configure the event publisher asActiveProjectorsEventPublisher?