Aaron
I think the best option would be to use MSMQ as a transport in NServiceBus. Here's what it might look like:
- send command via MSMQ
- in the command handler (re) creates an aggregate, which is the purpose of the command
- invoke operations
- save received events in EventStore along with the team message identifier to ensure idempotence. The unit itself will be responsible for knowing already processed teams.
- in a separate component (event processor) they use the EventStore persistent API to bind to the entire stream of events. Some of these processed events should result in a command being sent. Such a command can be sent through the NServiceBus send endpoint located inside this event processor.
- in this event processor, you can also republish all events through NServiceBus and MSMQ. Such events should not be subscribed by other services (see Note on autonomy below).
- NServiceBus Sagas (process managers) must live within the boundaries of your service and respond to commands and / or events sent or republished by these event processors via MSMQ.
One of the remarks regarding service boundaries is that you need to decide what level of service autonomy suits you: * Weak ones, where services can directly subscribe to other service event flows. In these design events that cross the service boundary, it is obviously allowed to carry data. * Strong, where services use events of a higher level for communication, and these events carry only the identity of things and there is no data . If you want something like this, you can use event processors to map ES events to these higher-level events.
source share