I am trying to further my understanding of DDD. More specifically, how to handle domain events via a message bus for asynchronous processing.
Lets say I have some architecture ->
_____________________
| |
| Client |
|_____________________|
|
__________|__________
| |
| Application Service |
|_____________________|
|
__________|__________
| |
| Domain |
|_____________________|
When my domain raises some domain event, how do I get that event to a messaging service such as RabbitMQ?
My first thought is to inject a message bus service, IMessageBus, that knows how to send the events to RabbitMQ. The service would be used by domain event handlers to dispatch the event to the bus.
But then I thought, now my domain has to know how to handle its own events.
Can someone shed some light on the matter?