entity-framework-coremicroservicesmasstransitoutbox-pattern

How to manage MassTransit Outbox pattern db schemas across microservices


I have many microservices and each have its own DbContext (one per microservice) and model. The db separation is by Schema in the same database. I want to use MassTransit Outbox pattern in all my microservices. My questions are:

  1. Does every microservice dbcontext have to configure MassTransit Outbox tables?
  2. Do I need to use One global MassTransit schema for those tables or do i create MassTransit tables in each microservice schema?
  3. How to manage those MassTransit tables with EF core migrations - every micro service will try to create those tables again, so how to manage them?

Thanks


Solution

    1. Yes
    2. You can put them in each schema, and each service would have its own bus delivery service targeting that schema using that DbContext.
    3. Since each schema has its own, it would be managed per service without issues.