Sending command from the command handler of an aggregate

My question is basically is it wrong?

If every time Aggregate 1 correctly handles Command 1 the application requires Command 2 to be sent to Aggregate 2.

Should we build a Saga to catch an event from Aggregate 1 (applied from Command 1 handler), send Command 2 and end immediately?

I feel this is the better approach to separate concerns, but would like some feedback.

Thank you

An event handler that consumes the corresponding event for Command1 and sends Command2 should suffice.

1 Like

A normal event handler, not Saga or EventSourcing, correct?

Correct Miguel, you’d maybe use a Saga if you had to coordinate more complex interactions between Aggregate 1 and 2.

One thing to consider however is if you care about the outcome of sending Command 2 from the event handler, i.e. if you want to retry the event (and therefore send Command 2 again) in case Command 2 isn’t processed correctly in its command handler.

A saga would be required if I want proper retry handling, right?

Regular @EventHandler will also retry on failure, depending on exception handler configuration.