[1.x] Fix delivering the signals to aggregate Mirror
s in a multi-Bounded Context environment
#1502
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 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 multipleMirror
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 inDelivery
. 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.