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

[1.x] Fix delivering the signals to aggregate Mirrors in a multi-Bounded Context environment #1502

Merged
merged 8 commits into from Feb 6, 2023

Conversation

armiol
Copy link
Contributor

@armiol armiol commented Feb 3, 2023

This changeset allows to properly access the read-side of Aggregates which are registered in different Bounded Contexts, and are exposed to read-side via the corresponding entity visibility.

In a Spine-based application, it is possible to expose an Aggregate state to the read-side. Under-the-hood it is done via system-internal Mirror projection, which accumulates all changes for all such Aggregates in scope of a single Bounded Context. At the same time, Delivery (which performs signal dispatching) relies onto the type URL of entities to which the dispatched signals are being delivered.

When several Bounded Contexts have their Aggregates "visible" (i.e. exposed via Mirror), Delivery is confused with multiple Mirror entity types which technically are distinct, but at the same time have exactly the same type URL. Such a use-cases leads to failures when Aggregate state on read-side is updated by the framework code.

This changeset alters the type URL, under which Mirror projections register themselves in Delivery. The new type URL value includes the name of the Bounded Context — which makes this type URL invalid in terms of type discovery, but addresses the issue.

An important thing to know is that such a workaround makes sense for 1.x codebase only, because Aggregate mirroring was already completely redesigned in scope of Spine 2.x.

@armiol armiol changed the base branch from master to 1.x-snapshot-aggregate-state-improvements February 3, 2023 15:51
@armiol armiol self-assigned this Feb 3, 2023
@armiol armiol changed the title [1.x] Fix delivering the signals to aggregate Mirrors in a multi-tenant environment [1.x] Fix delivering the signals to aggregate Mirrors in a multi-Bounded Context environment Feb 3, 2023
…overwriting for `Inbox` in system-wide `Delivery` in a multi-Bounded Context application.
Base automatically changed from 1.x-snapshot-aggregate-state-improvements to 1.x-dev February 6, 2023 12:58
@armiol armiol marked this pull request as ready for review February 6, 2023 14:55
@armiol
Copy link
Contributor Author

armiol commented Feb 6, 2023

@dmytro-kashcheiev FYI.

Copy link
Contributor

@alexander-yevsyukov alexander-yevsyukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@armiol armiol merged commit 7884fc7 into 1.x-dev Feb 6, 2023
@armiol armiol deleted the 1.x-multitenant-mirror-delivery branch February 6, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants