I would like to:
1) Application level, if the event triggers a modification of another unit in the same limited context.
2) The application level, if the event starts some infrastructure services.
eg. The letter is sent to the client. Therefore, an application service is required to download an order for mail content and mail, and then call the infrastructure service to send mail.
3) I prefer the domain service personally if the event triggers some operations in another limited context.
eg. Delivery or billing, implementation of a domain service infrastructure is responsible for integrating another limited context.
4) The level of infrastructure, if the event needs to be divided into several consumers. The consumer goes to 1), 2) or 3).
For me, the conclusion is the application layer, if the event leads to a separate acceptance test for your limited context.
By the way, what kind of infrastructure does your event last? Include event posting in a transaction?
source share