Im trying to figure out how exactly outbox is suppose to work with NServicebus but I'm not quite sure I get it. Here is the current scenario that we have:
Service1 Service2 Service3 ServiceN
Each of the services has its own database where it holds business data and servicebus shared database used for queue/message broker.
This means that each of these services is using the same connection string for servicebus and has different connection string for business database.
The problem we are facing is that saving into business database and publishing is technically saving into 2 databases, so this will create distributed transaction if wrapped into transaction.
Now, Im considering implementing outbox pattern to solve this problem, but NServiceBus documentation doesnt really give us an idea regarding this question:
- Where should Outbox table be stored? Is it suppose to be stored in a same database as bussiness data? Where will the subsciption data be stored in this case for given service? Is it possible to configure NServicebus to create outbox table into bussiness database while the rest of the tables are created in service bus database?
By enabling outbox NServiceBus indeed creates new table for holding messages servicename_Outbox table, but should it be stored into Servicebus database or business data database? If its stored in servicebus database then, technically to save data into it it still needs distributed transaction?
- How does servicebus know which table to pool for Outbox pattern and to dispatch messages? Can this be explicitly configured?