I tend to think of my domain as a physical calculator. It accepts input and produces output. This output can either be saved or released as events. Thus, there is some kind of behavior in the data, and the output is data. So it is very focused on behavior.
The script of your option (1) led to several DDD discussions around injection services or repositories (or, I think, the level of anti-corruption) in essence. The general consensus is that it should be avoided and you should choose, say, double sending. The fact is that the domain then needs additional information, and it either has to be transferred initially, or it needs to be extracted. In my calculator, a similar data selection is more like a calculator offering you more input.
If you go with parameter (1), then everything that calls the domain must handle any web call failure in order to retry.
If you go with option (2), where you use something like a service bus and, possibly, a process sorter (for example, a saga or a workflow), it is likely that the service bus handler or process engine will work with errors and repetitions.
I do not think that one solution is necessarily "better" than another, but "different." I would go with what was convenient for you, and if you already have an infrastructure related to failure / repetition, I would go with the option that is most easily supported by this infrastructure.
Hope that helps :)
Eben roux
source share