Search code examples
rabbitmqdomain-driven-designmicroservicesevent-driven-design

Are there some guidelines for identifying RabbitMQ queues for bounded context in DDD


I am about to make a Domain Driven Design arround RabbitMQ queue, and I am totally new to this. I would like to know if there are some guidelines for identifying the different queues considering the bounded contexts.

Stuffs like one queue per bounded context, or one queue per resource type within bounded contexts.

And since queues will normally cross different bounded contexts, it makes thing more complicated.

Any advice ?


Solution

  • You need one queue per type of consumer.

    Consider a type of consumer C1 that handles events of type E1 and E2. A queue Q1 is required into which all events of type E1 and E2 are routed. If another type of consumer C2 handles events of type E3 and E4, an queue Q2 is required into which all events of type E3 and E4 are routed.