Where does the message bus service live in Domain Driven Design

drizzie

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?

MikeSW

The Service Bus is part of the infrastructure, however the application services know about it (as an abstraction). It's ok to inject the bus into the app service, because the app service doesn't contain domain logic but acts as the coordinator and host of a business use case.

But then I thought, now my domain has to know how to handle its own events.

Yeah, but the bus only deliver the messages, the message handlers are basically application services.

Rabbit and others are an implementation details, your app handlers should be invoked by the service bus (which should abstract the actual messaging process).

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Where is the call to persistence in the domain driven design

From Dev

Where to find Domain Driven Design consultants?

From Dev

Azure Service Bus message time to live setting

From Dev

Layers in Domain Driven Design

From Dev

Separate application service for command / query in CQRS implementation in Domain Driven Design?

From Dev

Domain Driven Design for Rails App: Implementing a service in a basic example

From Dev

Where to put security when using DDD - domain driven design

From Dev

Where to put general purpose serialization class in domain driven design?

From Dev

Domain Driven Design - where should we put repositories?

From Dev

Domain Driven Design - Domain or Security

From Dev

How does Get method fits in domain driven design

From Dev

Access Control in Domain Driven Design

From Dev

Domain Driven Design and batch processing

From Dev

Implementing Domain Driven Design Cost

From Dev

Implementing Domain Driven Design Cost

From Dev

Domain Driven Design Bounded Context Domain Objects

From Dev

Domain Driven Design: infrastructure concern or domain concern?

From Dev

Domain Driven Design: infrastructure concern or domain concern?

From Dev

Domain Driven Design. Entity type design

From Dev

How does Azure Service Bus identify a duplicate message?

From Dev

Does Microsoft's Service Bus replicate message for every subscription in a topic?

From Dev

How does message locking and lock renewal work in Azure Service Bus?

From Dev

Implementing Paging and Sorting with Domain Driven Design

From Dev

Implementing Domain-Driven Design and Transactions

From Dev

Domain driven design repository implementation in infrastructure layer

From Dev

Domain Driven Design in Node.js Application

From Dev

Fetching associated aggregates in Domain driven Design

From Dev

Domain Driven Design - CQRS + ES usage

From Dev

Implementing Domain Driven Design Book Confusion

Related Related

  1. 1

    Where is the call to persistence in the domain driven design

  2. 2

    Where to find Domain Driven Design consultants?

  3. 3

    Azure Service Bus message time to live setting

  4. 4

    Layers in Domain Driven Design

  5. 5

    Separate application service for command / query in CQRS implementation in Domain Driven Design?

  6. 6

    Domain Driven Design for Rails App: Implementing a service in a basic example

  7. 7

    Where to put security when using DDD - domain driven design

  8. 8

    Where to put general purpose serialization class in domain driven design?

  9. 9

    Domain Driven Design - where should we put repositories?

  10. 10

    Domain Driven Design - Domain or Security

  11. 11

    How does Get method fits in domain driven design

  12. 12

    Access Control in Domain Driven Design

  13. 13

    Domain Driven Design and batch processing

  14. 14

    Implementing Domain Driven Design Cost

  15. 15

    Implementing Domain Driven Design Cost

  16. 16

    Domain Driven Design Bounded Context Domain Objects

  17. 17

    Domain Driven Design: infrastructure concern or domain concern?

  18. 18

    Domain Driven Design: infrastructure concern or domain concern?

  19. 19

    Domain Driven Design. Entity type design

  20. 20

    How does Azure Service Bus identify a duplicate message?

  21. 21

    Does Microsoft's Service Bus replicate message for every subscription in a topic?

  22. 22

    How does message locking and lock renewal work in Azure Service Bus?

  23. 23

    Implementing Paging and Sorting with Domain Driven Design

  24. 24

    Implementing Domain-Driven Design and Transactions

  25. 25

    Domain driven design repository implementation in infrastructure layer

  26. 26

    Domain Driven Design in Node.js Application

  27. 27

    Fetching associated aggregates in Domain driven Design

  28. 28

    Domain Driven Design - CQRS + ES usage

  29. 29

    Implementing Domain Driven Design Book Confusion

HotTag

Archive