Import Bus
Dispatches events to repositories of aggregates that import these events.
Usage Scenarios
Importing events may be used for registering facts occurred in a legacy or a third-party system, which the Bounded Context translates into facts (events) of its history.
Another scenario is registering facts occurred within a Bounded Context without having intermediate commands or events.
Adding an event to an aggregate history normally requires either a command (handling of which produces the event) or an event (reaction on which may produce the event). Such a command or an event:
- serves as a dispatched message type which is used as the first argument of the corresponding aggregate handler method;
- carries the information about the fact we want to remember.
Marking events and ensuring proper routing allows to store aggregate events without having intermediate messages.
Temporal Logic
Importing events through dispatching one or several events is designed for importing of events as they occur.
Importing events which occurred before the events already stored in the aggregate history may result in hard to track bugs, and is not recommended.
Types
Functions
ImportBus
.T
into an envelope of type E
.