When a saga is using an @SagaEventHandler to react to domain events is it best to schedule an internal event before processing a new command?
As an example I define two aggregates and one depends on the other for something. So when aggregate "A" publishes a "ItemAddedEvent" then aggregate "B" can be dispatched a command "AddToOrderCommand".
- aggregate "A" published "ItemAddedEvent"
- saga listening for that event schedules a "AddItemScheduledEvent" 100ms into the future
- saga listens for "AddItemScheduledEvent" and then dispatches "AddToOrderCommand"
- aggregate "B" processes command.
Or is it sufficient to just:
- aggregate "A" published "ItemAddedEvent"
- saga listens for "ItemAddedEvent" and then dispatches "AddToOrderCommand"
- aggregate "B" processes command.
My concern is threading. Should I be concerned?
Thanks,
Randy.